Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: avajs/ava
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v6.1.2
Choose a base ref
...
head repository: avajs/ava
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v6.1.3
Choose a head ref
  • 4 commits
  • 23 files changed
  • 4 contributors

Commits on Mar 31, 2024

  1. Add VS Code debugging instructions for Yarn PnP projects

    bitjson authored Mar 31, 2024
    Copy the full SHA
    01ec280 View commit details

Commits on Apr 17, 2024

  1. Document serial configuration option

    turadg authored Apr 17, 2024
    Copy the full SHA
    ec1a8d2 View commit details

Commits on May 5, 2024

  1. Include Node.js 22 in supported engines and test matrix

    Co-authored-by: Mark Wubben <mark@novemberborn.net>
    lenovouser and novemberborn authored May 5, 2024
    Copy the full SHA
    002b3a0 View commit details
  2. 6.1.3

    novemberborn committed May 5, 2024
    Copy the full SHA
    f8bf00c View commit details
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [^18.18, ^20.8, ^21]
node-version: [^18.18, ^20.8, ^21, ^22]
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4
1 change: 1 addition & 0 deletions docs/06-configuration.md
Original file line number Diff line number Diff line change
@@ -51,6 +51,7 @@ Arguments passed to the CLI will always take precedence over the CLI options con
- `failFast`: stop running further tests once a test fails
- `failWithoutAssertions`: if `false`, does not fail a test if it doesn't run [assertions](./03-assertions.md)
- `environmentVariables`: specifies environment variables to be made available to the tests. The environment variables defined here override the ones from `process.env`
- `serial`: if `true`, prevents parallel execution of tests within a file
- `tap`: if `true`, enables the [TAP reporter](./05-command-line.md#tap-reporter)
- `verbose`: if `true`, enables verbose output (though there currently non-verbose output is not supported)
- `snapshotDir`: specifies a fixed location for storing snapshot files. Use this if your snapshots are ending up in the wrong location
20 changes: 20 additions & 0 deletions docs/recipes/debugging-with-vscode.md
Original file line number Diff line number Diff line change
@@ -68,6 +68,26 @@ Assuming the names of your test files are unique you could try the following con
}
```

### Using Yarn PnP (Plug'n'Play)

As [Yarn's PnP (Plug'n'Play)](https://yarnpkg.com/features/pnp) installation strategy does not produce a `node_modules` folder, the `ava` binary must be called using `yarn run`:

```json
{
"type": "node",
"request": "launch",
"name": "Debug AVA test file",
"runtimeExecutable": "yarn",
"runtimeArgs": ["run", "ava"],
"args": ["${file}"],
"outputCapture": "std",
"console": "integratedTerminal", // optional
"skipFiles": [
"<node_internals>/**/*.js"
]
}
```

## Serial debugging

By default AVA runs tests concurrently. This may complicate debugging. Instead make sure AVA runs only one test at a time.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ava",
"version": "6.1.2",
"version": "6.1.3",
"description": "Node.js test runner that lets you develop with confidence.",
"license": "MIT",
"repository": "avajs/ava",
@@ -36,7 +36,7 @@
},
"type": "module",
"engines": {
"node": "^18.18 || ^20.8 || ^21"
"node": "^18.18 || ^20.8 || ^21 || ^22"
},
"scripts": {
"test": "./scripts/test.sh"
77 changes: 77 additions & 0 deletions test-tap/reporters/default.edgecases.v22.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@

---tty-stream-chunk-separator
(node:14147) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
(Use `node --trace-deprecation ...` to show where the warning was created)
---tty-stream-chunk-separator
⚠ Could not parse ast-syntax-error.cjs for line number selection

SyntaxError: Unexpected token (3:11)

---tty-stream-chunk-separator
Uncaught exception in ast-syntax-error.cjs

~/test-tap/fixture/report/edgecases/ast-syntax-error.cjs:3
const fn = do {
^^

SyntaxError: Unexpected token 'do'

---tty-stream-chunk-separator
✘ ast-syntax-error.cjs exited with a non-zero exit code: 1
---tty-stream-chunk-separator
(node:14149) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
(Use `node --trace-deprecation ...` to show where the warning was created)
---tty-stream-chunk-separator
✘ No tests found in ava-import-no-test-declaration.cjs
---tty-stream-chunk-separator
(node:14151) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
(Use `node --trace-deprecation ...` to show where the warning was created)
---tty-stream-chunk-separator

Uncaught exception in import-and-use-test-member.cjs

import-and-use-test-member.cjs:3

2:
 3: test('pass', t => t.pass());
4:

TypeError: test is not a function

› Object.<anonymous> (test-tap/fixture/report/edgecases/import-and-use-test-member.cjs:3:1)

---tty-stream-chunk-separator
✘ import-and-use-test-member.cjs exited with a non-zero exit code: 1
---tty-stream-chunk-separator
(node:14153) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
(Use `node --trace-deprecation ...` to show where the warning was created)
---tty-stream-chunk-separator
✘ No tests found in no-ava-import.cjs, make sure to import "ava" at the top of your test file
---tty-stream-chunk-separator
(node:14154) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
(Use `node --trace-deprecation ...` to show where the warning was created)
---tty-stream-chunk-separator
✘ Line numbers for test.cjs did not match any tests
---tty-stream-chunk-separator
(node:14155) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
(Use `node --trace-deprecation ...` to show where the warning was created)
---tty-stream-chunk-separator

Uncaught exception in throws.cjs

throws.cjs:1

 1: throw new Error('throws');
2:

Error: throws

› Object.<anonymous> (test-tap/fixture/report/edgecases/throws.cjs:1:7)

---tty-stream-chunk-separator
✘ throws.cjs exited with a non-zero exit code: 1
---tty-stream-chunk-separator
─

3 uncaught exceptions
---tty-stream-chunk-separator
27 changes: 27 additions & 0 deletions test-tap/reporters/default.failfast.v22.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

---tty-stream-chunk-separator
(node:14129) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
(Use `node --trace-deprecation ...` to show where the warning was created)
---tty-stream-chunk-separator
✘ [fail]: a › fails Test failed via `t.fail()`
---tty-stream-chunk-separator
─

a › fails

a.cjs:3

2:
 3: test('fails', t => t.fail());
4:

Test failed via `t.fail()`

› test-tap/fixture/report/failfast/a.cjs:3:22

─

`--fail-fast` is on. 1 test file was skipped.

1 test failed
---tty-stream-chunk-separator
27 changes: 27 additions & 0 deletions test-tap/reporters/default.failfast2.v22.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

---tty-stream-chunk-separator
(node:14130) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
(Use `node --trace-deprecation ...` to show where the warning was created)
---tty-stream-chunk-separator
✘ [fail]: a › fails Test failed via `t.fail()`
---tty-stream-chunk-separator
─

a › fails

a.cjs:3

2:
 3: test('fails', t => t.fail()); 
4: test('passes', t => t.pass());

Test failed via `t.fail()`

› test-tap/fixture/report/failfast2/a.cjs:3:22

─

`--fail-fast` is on. At least 1 test was skipped, as well as 1 test file.

1 test failed
---tty-stream-chunk-separator
16 changes: 16 additions & 0 deletions test-tap/reporters/default.only.v22.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

---tty-stream-chunk-separator
(node:14133) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
(Use `node --trace-deprecation ...` to show where the warning was created)
---tty-stream-chunk-separator
✔ a › only
---tty-stream-chunk-separator
(node:14136) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
(Use `node --trace-deprecation ...` to show where the warning was created)
---tty-stream-chunk-separator
✔ b › passes
---tty-stream-chunk-separator
─

2 tests passed
---tty-stream-chunk-separator
Loading