Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 17:40

    sindresorhus on main

    Minor tweaks (compare)

  • Jan 23 07:38

    sindresorhus on master

    (compare)

  • Jan 23 07:38

    sindresorhus on main

    (compare)

  • Jan 02 13:37

    sindresorhus on master

    Move to GitHub Actions (#16) (compare)

  • Jan 02 13:37
    sindresorhus closed #16
  • Jan 02 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
  • May 10 2020 07:40
    sindresorhus edited #32
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?
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.