Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Aug 05 2021 12:11
    adymorz synchronize #32
  • Jan 24 2021 17:40

    sindresorhus on main

    Minor tweaks (compare)

  • Jan 23 2021 07:38

    sindresorhus on master

    (compare)

  • Jan 23 2021 07:38

    sindresorhus on main

    (compare)

  • Jan 02 2021 13:37

    sindresorhus on master

    Move to GitHub Actions (#16) (compare)

  • Jan 02 2021 13:37
    sindresorhus closed #16
  • Jan 02 2021 13:17
    Richienb opened #16
  • Jun 03 2020 10:01
    fregante commented #14
  • Jun 03 2020 10:00
    fregante commented #14
  • Jun 03 2020 06:28
    novemberborn commented #14
  • Jun 02 2020 12:28
    fregante commented #14
  • Jun 02 2020 08:35
    novemberborn commented #15
  • Jun 02 2020 08:34
    novemberborn closed #14
  • Jun 02 2020 08:34
    novemberborn commented #14
  • Jun 02 2020 08:33
    novemberborn labeled #15
  • Jun 02 2020 08:33
    novemberborn opened #15
  • May 31 2020 23:19
    fregante edited #14
  • May 31 2020 23:12
    fregante edited #14
  • May 31 2020 23:12
    fregante opened #14
  • May 10 2020 07:40
    sindresorhus commented #32
Jacques Yakoub
@jy95
@mdvorscak If you want, here is my recent config for Babel 7 : https://github.com/jy95/torrent-files-library/blob/master/.babelrc.js . I had to use the compiled version of the code to deal with nyc code coverage issue
Mike Dvorscak
@mdvorscak
thanks @jy95 , I'll take a look
ezchen92
@ezchen92
Unable to get a stack trace for my error
Am I missing something here?
test/utils.js exited with a non-zero exit code: 1
Mark Wubben
@novemberborn
@Edwardzyc hard to say. it might have blown up in such a way that there’s nothing to show. can you share the project?
Dan Rosén
@danr
I made this feature request yesterday Expose functionality for the result of a test for test library writers avajs/ava#1692 with the use-case to enable property-based testing
Feel free to discuss it with me here as well
Pavel
@PavelPolyakov
hello, question regarding ava profile.js, I've tried to debug it using vs code, everything went well. BUT I see that all the imports have changed their names.
is it expected? I've googled the sourcemap and ava, but haven't found anything to fix the issue.
Pavel
@PavelPolyakov
tried ava@next and result is the same
Robert Blixt
@devghost_twitter
Anyone know if there exists some resource/example on how to test code using RequireJS/AMD with ava?
Mark Wubben
@novemberborn
@PavelPolyakov we do transpile import syntax. you’d have to use require() instead to avoid this
@devghost_twitter i don’t think we have a recipe for that. you should be able to use requirejs in your test files to load the code you’re testing. if you’re running into “no tests found” that might be because of the asynchronous module loading. avajs/ava#1693 fixes that
Robert Blixt
@devghost_twitter
@novemberborn yup, getting the "no tests found" thanks for the pointer :+1:
Pavel
@PavelPolyakov
@novemberborn all right, if it's that simple I just go with require, BUT, what if I want to use imports and all (some of) the esnext features. I expect ava should generate and use sourcemaps
Mark Wubben
@novemberborn
@PavelPolyakov it does. but what do you mean when you say that “all the imports have changed their names”? are you talking about available variables in the inspector window? those aren’t magically renamed by source maps
Pavel
@PavelPolyakov
yes, I thought about them. Who knows, I might be wrong, but I think in WebStorm it was picked up automatically, I might be wrong and can not test it right now.
Jacques Yakoub
@jy95
Since we are near 1.0 release , I wonder @novemberborn if your idea of extensions options to deal with the globbing mess is still on a todo list ?
Jacques Yakoub
@jy95

For example, I use FileHound that allows to do that. For example, here is a sample from my code that find all the media files (thanks @sindresorhus ) in a directory

const  videosExtension = require('video-extensions');
....
const foundFiles = FileHound.create()
            .paths((this.paths.length === 0) ? this.defaultPath : this.paths)
            .ext(videosExtension)
            .find();

The notable disavantage is that this stuff uses a sync way to search ...

Mark Wubben
@novemberborn
@jy95 it’s not necessarily related to globbing. it’s expectations on how AVA handles a particular file extension. now that the babel pipeline can be disabled it’s possible to specify additional extensions. i’ve just been focused on landing breaking changes first
Dan Rosén
@danr
What package is AVA using to watch the file system for changes?
Mark Wubben
@novemberborn
chokidar
Dan Rosén
@danr
@novemberborn thanks!
Jacques Yakoub
@jy95
@novemberborn no problemo : I said that because ava doesn't seem to handle my rewrited project (js to ts) , even if I specify 'test/*/.ts' in 'files' and use 'ts-node/register' in 'register'
andreGarvin
@andreGarvin
Hey is there a there a method that similar to this in ava test.after.all()
@novemberborn @sindresorhus
Sindre Sorhus
@sindresorhus
@andreGarvin You need to explain what it would do.
Mark Wubben
@novemberborn

As Gitter's development seems to have slowed since their acquisition by GitLab we're moving our chat to Spectrum. It's a new product so still rough around the edges, but it's way more than a chat room which we think will be quite useful for the AVA community.

Come join us at spectrum.chat/ava!

Stephan Meijer
@smeijer
Is there a "solve all babel-7-problems" document somewhere? I cannot get the test-runner up and running since I updated babel to 7, and ava to the 1.0-x release
For example, even with a simple config as below, I still have SyntaxError: Unexpected token import errors.
 "ava": {
    "files": [
        // ...
    ],
    "require": [
      "@babel/register",
      "@babel/polyfill"
    ],
    "babel": {
      "testOptions": {
        "babelrc": false,
        "presets": [
          "@babel/preset-stage-2",
          "@babel/preset-react"
        ]
      }
    }
  },
Stephan Meijer
@smeijer
when I add @std/esm to the require list, the import statements work. But than I get errors like: '× No tests found in ...' :confused:
Stephan Meijer
@smeijer
okay, the no tests found is caused by an uncaught exception. Something seems to be wrong with the imports. A simple file as this is causing the issue:
import { GraphQLError } from 'graphql';

class CustomError extends GraphQLError {
  constructor(message, errors = []) {
    super(message);
  }
}

The real error here is somehow in the graphql package. When I extend a custom class class BaseError { constructor() {} } than all seems to be fine.

So, I'm getting closer, but not really understanding what's happening :confused:

Mark Wubben
@novemberborn
@smeijer please post your question in https://spectrum.chat/ava. i suspect it's to do with your source files not being transpiled correctly though. make sure to post a stack trace and your "babelrc" config to spectrum too
Iakiv Kramarenko
@yashaka
Hey guys. Maybe stupid question... So... AVA can run concurrently test FILES, not TESTs in the same file, right?
Mark Wubben
@novemberborn
Hi, please post your question on Spectrum. See above for the link
Iakiv Kramarenko
@yashaka
I can't login there...
no facebook, google, or github log in worked for me...
Mark Wubben
@novemberborn
Any error message I can relay for you?
Iakiv Kramarenko
@yashaka
twitter did not work too... "internal server error". Tried in chrome and firefox
for facebook and github - it just redirects to the spectrum main page
Mark Wubben
@novemberborn
Odd. To your question then, tests do run concurrently, but whether this has an impact depends on whether they're asynchronous or not. Node doesn't run synchronous code concurrently.
Iakiv Kramarenko
@yashaka

hm...
so...
given i have 2 test files with 2 tests in each...
and each test contains async function with implementation
and this implementation is synchronous code, like 3 serial actions
when executing with ava
then there will be two process created for each test file
and instide each process two tests will be triggered concurrently
BUT real actions from both tests among same file will not be executed concurrently. First node will execute one series for 3 actions from one test, then another series of 3 actions from another test from the same file...
AND in parallel - the same will happen concurrently for another test file...

right? :)

Mark Wubben
@novemberborn
Uhm, sure (bit busy so can't verify the exact behavior here). It shouldn't matter is what it comes down to, unless your tests somehow depend on each other which is bad but at times unavoidable. Use test.serial if you're running into that problem
Iakiv Kramarenko
@yashaka

I am actually considering using ava for browser tests, based on selenium webdriver.
All my tests, including tests in the same file are independent. Each test in the same file will open it's own browser and execute a series of actions in it. Then close the browser in the end. So I want to run these concurrently. The problem I have with current test runner is that I can parallelize only files, not tests in the same file. All code from the tests in the same file will be executed sequentially...

question is whether with AVA it will be the same...

Mark Wubben
@novemberborn
it will start all your non-explicitly-serial tests at the same time
Iakiv Kramarenko
@yashaka
thank you, Mark, i will try!
Nisha Sowdri
@sowdri
When a single test in a file is run using t.only(...) and if u is pressed in console to update the snapshots, then the snapshots for all the other tests in the file are replaced with the new snapshot for the current test. Is there a solution to udpate only the snapshots for the current test and leave the other snapshots alone?