Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jun 03 10:01
    fregante commented #14
  • Jun 03 10:00
    fregante commented #14
  • Jun 03 06:28
    novemberborn commented #14
  • Jun 02 12:28
    fregante commented #14
  • Jun 02 08:35
    novemberborn commented #15
  • Jun 02 08:34
    novemberborn closed #14
  • Jun 02 08:34
    novemberborn commented #14
  • Jun 02 08:33
    novemberborn labeled #15
  • Jun 02 08:33
    novemberborn opened #15
  • May 31 23:19
    fregante edited #14
  • May 31 23:12
    fregante edited #14
  • May 31 23:12
    fregante opened #14
  • May 10 07:40
    sindresorhus commented #32
  • May 10 07:40
    sindresorhus edited #32
  • Mar 28 12:07
    adymorz commented #32
  • Mar 28 11:22
    novemberborn commented #32
  • Mar 27 18:18
    adymorz commented #32
  • Mar 27 15:08
    adymorz commented #32
  • Mar 27 14:55
    adymorz commented #32
  • Mar 27 14:54
    adymorz commented #32
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?
Bhuvin Thakker
@bhuvinth
I am trying to install Ava so as to try it for our Project. But apparently I have been facing a lot of issues regarding Babel. I tried to upgrade the Babel but again stuck on Plugin/Preset files are not allowed to export objects.
Please find the things which I did as below:
npm install --global ava
ava --init
And there were a lot of issues for the Babel dependencies, after installing what errors it faced it is stuck on the above message.
Please help.
Tianhao SHI
@SHITianhao
How to require ts-node/register inside vscode debugger launch.json?

I did with those args

      "args": [
        "--ext",
        "ts",
        "--require",
        "ts-node/register",
        "${file}"
      ],

but it doesn't work

Satya Rohith
@satyarohith
Thanks for ava! Should we use any config to run tests in travis? Tests are passing localy but fails in travis. Thanks for taking time!
Sean Genabe
@seangenabe
      "runtimeArgs": [
        "-r",
        "ts-node/register"
      ],
Dimitri Mitropoulos
@dimitropoulos
does anyone know how I can use vscode's debugger with ava and typescript?
presently, I have scripts in my package.json that looks like this:
  "scripts": {
    "test": "tsc && ava",
    "test:serial": "node ./node_modules/.bin/tsc && node --inspect-brk=5858 ./node_modules/.bin/ava --serial",
    "test:watch": "tsc && ava --watch"
  },
ideally, I can do something like this in my launch.json file
        {
            "type": "node",
            "request": "launch",
            "name": "Run AVA tests",
            "runtimeExecutable": "yarn",
            "runtimeArgs": [
                "test:serial"
            ],
            "port": 5858,
            "stopOnEntry": true,
            "sourceMaps": true,
            "cwd": "${workspaceFolder}/my/subdirectory"
        }
Dimitri Mitropoulos
@dimitropoulos
but when I run the above it either get's stuck (breaks) at the first line of ava/cli.jsor just hangs and does nothing at all (depending on other settings)
I also can't seem to see the output on the debug console even when I set outputCapture to std if I use the --inspect-brk flag
Dimitri Mitropoulos
@dimitropoulos
update: nevermind - I moved to jest and it's working. thanks all :)
Qaiser Abbas
@qaiser110
i'd like the avajs test failure logs in the console and also use tap reporter. Is there a way to do that?
Gregor Woiwode
@GregOnNet

Hi,

I there, I fear I ask an often asked question. Yet I did not find an answer. Did someone of you manage getting AvaJS running with Angular 8? If not, does someone know the main problems to come up with a proper configuration? Thanks in advance.

PS: Please find attached the sources I read so far

Sathish
@sathishsoundharajan
without using .serial ?
Ben Chiciudean
@benydc
I have 2 serial tasks and I add on the first one a t.context.demo = "tesfdcd" but the second serial test has t.context.demo undefined
can someone help please?
Andrius Solopovas
@asolopovas
Hi Everyone, I can't seem to get the watch feature to work. I have created the folder tests and added dum test, also configured the following in my package.json
  "scripts": {
    "start": "node index.js",
    "test": "ava",
    "test-watch": "ava --watch"
  },
  "ava": {
    "sources": [
      "src/**/*"
    ],
    "files": [
      "tests/**/*"
    ]
  },
if I run test-watch it runs the test the first time but does not rerun it on changes in tests of src directory
what am I doing wrong?
Seth Holladay
@sholladay
@asolopovas does it work if you delete sources from your config? I'm not certain about the semantics within AVA's internals, but I think the problem might be that you are overriding the default glob patterns for which files to watch, rather than adding to them. Since your test files are not listed in sources, that would mean changes to your tests do not cause the tests to be re-run. But the default does include the test files, so deleting sources should fix it.
Andrius Solopovas
@asolopovas
@sholladay If I remove sources it doesn't change anything but what triggers restart of test if I change somthing inside package json but it ignores other files in root directory
Corey Farrell
@coreyfarrell
I have a project where most test files can run parallel but one test file needs to be serialized. Is it reasonable for that one test file to do import {serial as test} from 'ava';? The intent is for this one test file to act as though it were run with ava -s. I do use test.before and test.after.always in this specific test file.
Andrius Solopovas
@asolopovas
Hi Everyone, is there a way to change Everything module name or alias it to something like ev: rather than Everithyng:
I can't seem to find docs for that maybe someone can point me to right direction
I don't mind reading its just that I can find the stuff I need, googling didn't help either.
and is there a way to prioritize apps over the rest of results when searching in default window
without opening them to improve ranking in resutls
Andy Chen
@KsRyY
How to use TypeScript in AVA?
Just write tests with TypeScript or is there any need to transform?
Denis Zhirkov
@dolphin4ik
Hi there!
Who can help with ava and typescript project?
I have this error - "error TS2304: Cannot find name 'DeviceFile'."
the file is
class Device {
    id: string;
    path: string;
    files: Array<DeviceFile>;
    treatmentsCount: number;

    get isEmpty(): boolean {
        return this.files.length === 0;
    }
}

export default Device;
DeviceFile is in types.d.ts near
wtf?
Norbert KΓ©ri
@norbertkeri
hey, is there any way to keep track of how many tests are currently running? I parallelized our integration tests, but now we are running into the postgres max_connections limit
I am wondering if I could somehow keep track of how many tests are currently running, and throttle
I tried putting a counter on t.context, but of course that doesn't work, since every fork gets their own t
I guess I want some kind of ipc between the test runners
Jason Allan
@OiYouYeahYou
Ava's official support channel is now https://spectrum.chat/ava
Andrius Solopovas
@asolopovas
Guys isn't anyone of you annoyed about the chrome console bug where "selected context only" setting does not persist, doesn't it bother you when you get error messages from plugins rather than from application you develop? Can at least a few of you vote for this to be fixed?
https://bugs.chromium.org/p/chromium/issues/detail?id=901863
Alex Vazquez
@seisvelas
I am so stuck :o
$ npx ava build/account/source/test.js --verbose

  βœ– Couldn’t find any files to test
I'm pointing it to a file (that definitely exists) and it says it can't find any files to test ;_;
That file is full of tests.
OliverNChalk
@OliverNChalk
I have a class that is meant to throw an error when it receives a certain network response. I have mocked the networking component and can return this response, however, I am unable to test it because the error is not thrown as a part of any direct call stack from the test file. It is thrown asynchronously as a part of a timer callback within the tested class. Is my only option to mock the timer and make the call manually, or is there a way to cast a catch all on unhandledRejections?