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.
* 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.
* Split across multiple files.
* Rename types, most noticeably `TestInterface` is now `TestFn`, but
really anything that had the Interface suffix has been changed.
* Update some documentation.
Fixes#2189. `test.macro()` returns an object that can be used with
`test()` and hooks. The `t.context` type is inherited from `test`.
Like with AVA 3, regular functions that also have a `title` property
that is a string-returning function are supported. However this is no
longer in the type definition.
Instead the recommended approach is to use `test.macro()` to declare
macros. At a TypeScript level these are easier to discriminate from
regular implementations.
This affects test() and t.try().
Supporting multiple implementations made both the implementation and the
type definitions needlessly complex. Using for/of syntax it's easy
enough to declare tests (or t.try() attempts) with the same arguments.
Update the `deepEqual`, `like`, `false`, `true` and `is` assertions so
they can be used as type guards. Fixes#2456.
Change the `deepEqual`, `like` and `is` assertions so the actual and
expected parameters can be typed separately. Fixes#2580.
* Remove Node.js 13 support
* Denote Node.js 12.17 as the future minimal Node.js 12 version
* Update dev dependencies
* Upgrade XO
* Update dependencies
* Rebuild lockfile
Detect subscribables and convert to promise. Simplify type description to match what AVA actually requires.
Co-authored-by: Mark Wubben <mark@novemberborn.net>
Previously, AVA would pass the empty string. By passing an undefined value, the title function can use argument defaults which is more natural.
This is a breaking change for users who were concatenating `title`, under the assumption it was an empty string.
Fixes#1686.
Updates the assertion skipping type definitions to be in line with the actual implementation.
Allow `.end()` in `CbExecutionContext` to take an error value.
Fix hook typing so it's clearer plain implementations can be used without a title. This was possible before through a macro, which was misleading.
Co-authored-by: Arjay Sitoy <sitoy.arjay@gmail.com>
Co-authored-by: Mark Wubben <mark@novemberborn.net>