Commit graph

9 commits

Author SHA1 Message Date
Mark Wubben
3ebe65cbeb
Re-organize types for maximum compatibility
Add shims for TypeScript's 'node' module resolution algorithm. The exports map is only used with the `node16` algorithm.

Write types in CommonJS, so they can be exported from ESM files. The other way around is prone to, at the very least, confusing warnings.
2022-09-25 16:31:54 +02:00
Mark Wubben
02f4e27b53
Rely on TypeScript 4.7 and update integration + tests
* Only test against TypeScript 4.7

* Move type definitions to entrypoints/

Only TS 4.7 will resolve them now, but it's cleaner.

* Use @sindresorhus/tsconfig

* Fix test TypeScript files, make compilable and lintable

* Use tsc directly, instead of tsd

* Add *.cts versions of type tests

* Reorganize type tests

* Use tsc directly, avoid npx, print actual version

Somehow `npx tsc` was pointing at an older version. Possibly the binstubs are corrupted in CI… somehow.
2022-07-10 18:30:04 +02:00
Mark Wubben
388ea53ab7
Improve typing of teardown methods
* Explicitly type t.teardown() functions to return a promise

This helps with the @typescript-eslint/no-misused-promises ESLint rule.

* Fix typing of plugin teardown

The returned method always returns Promise<void>. The teardown function itself may or may not return a promise. Support both to help with the @typescript-eslint/no-misused-promises ESLint rule.
2022-04-10 18:30:39 +02:00
Mark Wubben
60b7cf8f56
Align shared worker protocol identifier with provider protocols 2021-11-01 16:40:35 +01:00
Mark Wubben
ad521af670 Graduate shared workers to be non-experimental 2021-11-01 15:37:55 +01:00
Mark Wubben
e8a497696a
Update all the things
* Test lockfile using npm 7.23

* Workflow updates

* Update codecov action
* Cache npm dependencies
* Simplify checkout

* Bump minimal Node.js versions

These should allow us to add features over AVA 4's lifetime using newly
available Node.js APIs.

* Update dev dependencies

* Update to TypeScript 4.4 and latest tsd

* Upgrade XO and reformat

* Update dependencies

* Rebuild lockfile

* Run XO with Node.js 16

It fails on older Node.js versions.
2021-09-12 22:00:38 +02:00
Mark Wubben
c57067bfb6
Switch to ESM for internals
* Extract glob helpers that are needed in a CJS environment

* Ensure ava/plugin works in a CJS environment

Refactor and deploy some tricks so that ava/plugin is usable in a CJS environment, even if the rest of AVA's internals become ESM.

* Ensure 'ava' can be imported in a CJS environment

* Convert to ESM

* Load yargs as CJS due to strange compatibility issues
* Keep line number parsing code as CJS because it attempts to lazy-load dependencies
* Shared workers are always loaded through a dynamic import
* Shared worker filenames must now be file:// URLs, but you can provide a URL instance
* Test file paths within shared workers are now file:// URLs
* Error serialization and code excerpts now support ESM
* Title prefixes in the reporters now correctly skip all test file extensions, not just `js`

* CI: Increase delay on timeout test, mostly for Windows
2021-06-06 15:39:52 +02:00
Mark Wubben
73015e57f6
Update dependencies & fix reporter tests
* Fix reporter tests under Node.js 15

Fixes #2616.

* Update dev dependencies

* Update XO

* Update TypeScript

* Update dependencies

* Rebuild package lock

* Churn reporter logs
2020-11-30 16:27:48 +01:00
Mark Wubben
512454704d Experimentally implement shared workers 2020-09-20 11:05:57 +02:00