From 058b5be55ed5f846f71494c2f105c6bd6fdd3fc3 Mon Sep 17 00:00:00 2001 From: Mark Wubben Date: Sat, 21 Mar 2020 17:20:47 +0100 Subject: [PATCH 1/5] Simplify Codecov setup --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 02e439e..e3b0910 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,5 +25,3 @@ jobs: - run: npm install --no-audit - run: npm test - uses: codecov/codecov-action@v1 - with: - token: ${{ secrets.CODECOV_TOKEN }} From 96b4ae4ad282bef17a6de6976c630a238a0e31f9 Mon Sep 17 00:00:00 2001 From: Adam Lynch Date: Sat, 2 May 2020 14:15:25 +0100 Subject: [PATCH 2/5] Clarify use --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c403a50..a14ec94 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@ Adds rudimentary [TypeScript](https://www.typescriptlang.org/) support to [AVA](https://avajs.dev). -This is designed to work for projects that precompile TypeScript. It allows AVA to load the compiled JavaScript, while configuring AVA to treat the TypeScript files as test files. +This is designed to work for projects that precompile their TypeScript code, including tests. It allows AVA to load the resulting JavaScript, while configuring AVA to use the TypeScript paths. -In other words, say you have a test file at `src/test.ts`. You've configured TypeScript to output to `build/`. Using `@ava/typescript` you can run the test using `npx ava src/test.ts`. +In other words, say you have a test file at `src/test.ts`. You've configured TypeScript to output to `build/`. Using `@ava/typescript` you can run the `build/test.js` file using `npx ava src/test.ts`. AVA won't pick up any of the JavaScript files present in the `build/` directory, unless they have a TypeScript counterpart in `src/`. ## Enabling TypeScript support From de9c6f76dc9784583feb0337e2f65da2a8214f45 Mon Sep 17 00:00:00 2001 From: Mark Wubben Date: Sun, 11 Apr 2021 15:30:27 +0200 Subject: [PATCH 3/5] Updates and breaking changes * Update minimal Node.js versions * Update dev dependencies * Update dependencies * Remove support for the ava-3 protocol --- .github/workflows/ci.yml | 2 +- .gitignore | 1 - index.js | 2 +- package.json | 16 ++-- test/protocol-ava-3.2.js | 81 ++++++++++++++++++- test/protocol-ava-3.js | 101 ------------------------ test/snapshots/protocol-ava-3.2.js.md | 86 ++++++++++++++++++++ test/snapshots/protocol-ava-3.2.js.snap | Bin 296 -> 712 bytes test/snapshots/protocol-ava-3.js.md | 91 --------------------- test/snapshots/protocol-ava-3.js.snap | Bin 494 -> 0 bytes 10 files changed, 176 insertions(+), 204 deletions(-) delete mode 100644 test/protocol-ava-3.js delete mode 100644 test/snapshots/protocol-ava-3.js.md delete mode 100644 test/snapshots/protocol-ava-3.js.snap diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e3b0910..4c247ee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - node-version: [^10.18.0, ^12.14.0, ^13.5.0] + node-version: [^12.22, ^14.16, ^15] os: [ubuntu-latest, windows-latest] steps: - uses: actions/checkout@v1 diff --git a/.gitignore b/.gitignore index 4f52d76..ccc2930 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ -/.nyc_output /coverage /node_modules diff --git a/index.js b/index.js index c054114..c48265e 100644 --- a/index.js +++ b/index.js @@ -27,7 +27,7 @@ function isValidRewritePaths(rewritePaths) { } module.exports = ({negotiateProtocol}) => { - const protocol = negotiateProtocol(['ava-3.2', 'ava-3'], {version: pkg.version}); + const protocol = negotiateProtocol(['ava-3.2'], {version: pkg.version}); if (protocol === null) { return; } diff --git a/package.json b/package.json index 7e1ac53..228b04a 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "1.1.1", "description": "TypeScript provider for AVA", "engines": { - "node": ">=10.18.0 <11 || >=12.14.0 <13 || >=13.5.0" + "node": ">=12.22 <13 || >=14.16 <15 || >=15" }, "files": [ "index.js" @@ -16,18 +16,18 @@ "typescript" ], "scripts": { - "test": "xo && nyc ava" + "test": "xo && c8 ava" }, "dependencies": { - "escape-string-regexp": "^2.0.0" + "escape-string-regexp": "^4.0.0" }, "devDependencies": { - "ava": "^3.0.0", - "execa": "^4.0.0", - "nyc": "^15.0.0", - "xo": "^0.25.3" + "ava": "^3.15.0", + "c8": "^7.7.1", + "execa": "^5.0.0", + "xo": "^0.38.2" }, - "nyc": { + "c8": { "reporter": [ "html", "lcov", diff --git a/test/protocol-ava-3.2.js b/test/protocol-ava-3.2.js index 8400002..82d41d0 100644 --- a/test/protocol-ava-3.2.js +++ b/test/protocol-ava-3.2.js @@ -1,5 +1,6 @@ const path = require('path'); const test = require('ava'); +const execa = require('execa'); const pkg = require('../package.json'); const makeProvider = require('..'); @@ -8,7 +9,7 @@ const withProvider = (t, run) => run(t, makeProvider({ t.true(identifiers.includes('ava-3.2')); t.is(version, pkg.version); return { - ava: {version: '3.2.0'}, + ava: {version: '3.15.0'}, identifier: 'ava-3.2', normalizeGlobPatterns: patterns => patterns, async findFiles({patterns}) { @@ -19,8 +20,60 @@ const withProvider = (t, run) => run(t, makeProvider({ } })); +const validateConfig = (t, provider, config) => { + const error = t.throws(() => provider.main({config})); + error.message = error.message.replace(`v${pkg.version}`, 'v${pkg.version}'); // eslint-disable-line no-template-curly-in-string + t.snapshot(error); +}; + test('negotiates ava-3.2 protocol', withProvider, t => t.plan(2)); +test('main() config validation: throw when config is not a plain object', withProvider, (t, provider) => { + validateConfig(t, provider, false); + validateConfig(t, provider, true); + validateConfig(t, provider, null); + validateConfig(t, provider, []); +}); + +test('main() config validation: throw when config contains keys other than \'extensions\' or \'rewritePaths\'', withProvider, (t, provider) => { + validateConfig(t, provider, {foo: 1}); +}); + +test('main() config validation: throw when config.extensions contains empty strings', withProvider, (t, provider) => { + validateConfig(t, provider, {extensions: ['']}); +}); + +test('main() config validation: throw when config.extensions contains non-strings', withProvider, (t, provider) => { + validateConfig(t, provider, {extensions: [1]}); +}); + +test('main() config validation: throw when config.extensions contains duplicates', withProvider, (t, provider) => { + validateConfig(t, provider, {extensions: ['ts', 'ts']}); +}); + +test('main() config validation: config may not be an empty object', withProvider, (t, provider) => { + validateConfig(t, provider, {}); +}); + +test('main() config validation: rewrite paths must end in a /', withProvider, (t, provider) => { + validateConfig(t, provider, {rewritePaths: {src: 'build/'}}); + validateConfig(t, provider, {rewritePaths: {'src/': 'build'}}); +}); + +test('main() extensions: defaults to [\'ts\']', withProvider, (t, provider) => { + t.deepEqual(provider.main({config: {rewritePaths: {'src/': 'build/'}}}).extensions, ['ts']); +}); + +test('main() extensions: returns configured extensions', withProvider, (t, provider) => { + const extensions = ['tsx']; + t.deepEqual(provider.main({config: {extensions, rewritePaths: {'src/': 'build/'}}}).extensions, extensions); +}); + +test('main() extensions: always returns new arrays', withProvider, (t, provider) => { + const main = provider.main({config: {rewritePaths: {'src/': 'build/'}}}); + t.not(main.extensions, main.extensions); +}); + test('main() ignoreChange()', withProvider, (t, provider) => { const main = provider.main({config: {rewritePaths: {'src/': 'build/'}}}); t.true(main.ignoreChange(path.join(__dirname, 'src/foo.ts'))); @@ -41,3 +94,29 @@ test('main() updateGlobs()', withProvider, (t, provider) => { ignoredByWatcherPatterns: ['assets/**'] })); }); + +const compile = async provider => { + return { + state: await provider.main({ + config: { + rewritePaths: { + 'typescript/': 'fixtures/' + } + } + }).compile() + }; +}; + +test('worker(): load rewritten paths files', withProvider, async (t, provider) => { + const {state} = await compile(provider); + const {stdout, stderr} = await execa.node( + path.join(__dirname, 'fixtures/install-and-load'), + ['ava-3', JSON.stringify(state), path.join(__dirname, 'typescript', 'file.ts')], + {cwd: path.join(__dirname, 'fixtures')} + ); + if (stderr.length > 0) { + t.log(stderr); + } + + t.snapshot(stdout); +}); diff --git a/test/protocol-ava-3.js b/test/protocol-ava-3.js deleted file mode 100644 index 5839f6e..0000000 --- a/test/protocol-ava-3.js +++ /dev/null @@ -1,101 +0,0 @@ -const path = require('path'); -const test = require('ava'); -const execa = require('execa'); -const pkg = require('../package.json'); -const makeProvider = require('..'); - -const withProvider = (t, run) => run(t, makeProvider({ - negotiateProtocol(identifiers, {version}) { - t.true(identifiers.includes('ava-3')); - t.is(version, pkg.version); - return { - ava: {version: '3.0.0'}, - identifier: 'ava-3', - normalizeGlobPatterns: patterns => patterns, - async findFiles({patterns}) { - return patterns.map(file => path.join(__dirname, file)); - }, - projectDir: __dirname - }; - } -})); - -const validateConfig = (t, provider, config) => { - const error = t.throws(() => provider.main({config})); - error.message = error.message.replace(`v${pkg.version}`, 'v${pkg.version}'); // eslint-disable-line no-template-curly-in-string - t.snapshot(error); -}; - -test('negotiates ava-3 protocol', withProvider, t => t.plan(2)); - -test('main() config validation: throw when config is not a plain object', withProvider, (t, provider) => { - validateConfig(t, provider, false); - validateConfig(t, provider, true); - validateConfig(t, provider, null); - validateConfig(t, provider, []); -}); - -test('main() config validation: throw when config contains keys other than \'extensions\' or \'rewritePaths\'', withProvider, (t, provider) => { - validateConfig(t, provider, {foo: 1}); -}); - -test('main() config validation: throw when config.extensions contains empty strings', withProvider, (t, provider) => { - validateConfig(t, provider, {extensions: ['']}); -}); - -test('main() config validation: throw when config.extensions contains non-strings', withProvider, (t, provider) => { - validateConfig(t, provider, {extensions: [1]}); -}); - -test('main() config validation: throw when config.extensions contains duplicates', withProvider, (t, provider) => { - validateConfig(t, provider, {extensions: ['ts', 'ts']}); -}); - -test('main() config validation: config may not be an empty object', withProvider, (t, provider) => { - validateConfig(t, provider, {}); -}); - -test('main() config validation: rewrite paths must end in a /', withProvider, (t, provider) => { - validateConfig(t, provider, {rewritePaths: {src: 'build/'}}); - validateConfig(t, provider, {rewritePaths: {'src/': 'build'}}); -}); - -test('main() extensions: defaults to [\'ts\']', withProvider, (t, provider) => { - t.deepEqual(provider.main({config: {rewritePaths: {'src/': 'build/'}}}).extensions, ['ts']); -}); - -test('main() extensions: returns configured extensions', withProvider, (t, provider) => { - const extensions = ['tsx']; - t.deepEqual(provider.main({config: {extensions, rewritePaths: {'src/': 'build/'}}}).extensions, extensions); -}); - -test('main() extensions: always returns new arrays', withProvider, (t, provider) => { - const main = provider.main({config: {rewritePaths: {'src/': 'build/'}}}); - t.not(main.extensions, main.extensions); -}); - -const compile = async provider => { - return { - state: await provider.main({ - config: { - rewritePaths: { - 'typescript/': 'fixtures/' - } - } - }).compile() - }; -}; - -test('worker(): load rewritten paths files', withProvider, async (t, provider) => { - const {state} = await compile(provider); - const {stdout, stderr} = await execa.node( - path.join(__dirname, 'fixtures/install-and-load'), - ['ava-3', JSON.stringify(state), path.join(__dirname, 'typescript', 'file.ts')], - {cwd: path.join(__dirname, 'fixtures')} - ); - if (stderr.length > 0) { - t.log(stderr); - } - - t.snapshot(stdout); -}); diff --git a/test/snapshots/protocol-ava-3.2.js.md b/test/snapshots/protocol-ava-3.2.js.md index 121606e..98cbcff 100644 --- a/test/snapshots/protocol-ava-3.2.js.md +++ b/test/snapshots/protocol-ava-3.2.js.md @@ -4,6 +4,86 @@ The actual snapshot is saved in `protocol-ava-3.2.js.snap`. Generated by [AVA](https://avajs.dev). +## main() config validation: throw when config is not a plain object + +> Snapshot 1 + + Error { + message: 'Unexpected Typescript configuration for AVA. See https://github.com/avajs/typescript/blob/v${pkg.version}/README.md for allowed values.', + } + +> Snapshot 2 + + Error { + message: 'Unexpected Typescript configuration for AVA. See https://github.com/avajs/typescript/blob/v${pkg.version}/README.md for allowed values.', + } + +> Snapshot 3 + + Error { + message: 'Unexpected Typescript configuration for AVA. See https://github.com/avajs/typescript/blob/v${pkg.version}/README.md for allowed values.', + } + +> Snapshot 4 + + Error { + message: 'Unexpected Typescript configuration for AVA. See https://github.com/avajs/typescript/blob/v${pkg.version}/README.md for allowed values.', + } + +## main() config validation: throw when config contains keys other than 'extensions' or 'rewritePaths' + +> Snapshot 1 + + Error { + message: 'Unexpected Typescript configuration for AVA. See https://github.com/avajs/typescript/blob/v${pkg.version}/README.md for allowed values.', + } + +## main() config validation: throw when config.extensions contains empty strings + +> Snapshot 1 + + Error { + message: 'Unexpected Typescript configuration for AVA. See https://github.com/avajs/typescript/blob/v${pkg.version}/README.md for allowed values.', + } + +## main() config validation: throw when config.extensions contains non-strings + +> Snapshot 1 + + Error { + message: 'Unexpected Typescript configuration for AVA. See https://github.com/avajs/typescript/blob/v${pkg.version}/README.md for allowed values.', + } + +## main() config validation: throw when config.extensions contains duplicates + +> Snapshot 1 + + Error { + message: 'Unexpected Typescript configuration for AVA. See https://github.com/avajs/typescript/blob/v${pkg.version}/README.md for allowed values.', + } + +## main() config validation: config may not be an empty object + +> Snapshot 1 + + Error { + message: 'Unexpected Typescript configuration for AVA. See https://github.com/avajs/typescript/blob/v${pkg.version}/README.md for allowed values.', + } + +## main() config validation: rewrite paths must end in a / + +> Snapshot 1 + + Error { + message: 'Unexpected Typescript configuration for AVA. See https://github.com/avajs/typescript/blob/v${pkg.version}/README.md for allowed values.', + } + +> Snapshot 2 + + Error { + message: 'Unexpected Typescript configuration for AVA. See https://github.com/avajs/typescript/blob/v${pkg.version}/README.md for allowed values.', + } + ## main() updateGlobs() > Snapshot 1 @@ -19,3 +99,9 @@ Generated by [AVA](https://avajs.dev). 'build/**/*.js.map', ], } + +## worker(): load rewritten paths files + +> Snapshot 1 + + 'logged in file.js' diff --git a/test/snapshots/protocol-ava-3.2.js.snap b/test/snapshots/protocol-ava-3.2.js.snap index d5b6a0d95e73ce9b91665eedfe98971e388572e1..b76e02de8b92142378fb21b375ac4bfc6536573b 100644 GIT binary patch literal 712 zcmV;(0yq6ZRzVM2Q5=518F$xRtzGF4Dnu)IX{8wuvM?1_^HPYFxl3MRcK7Yb~Gw|_#^L^j@z4?A~c|JhM zjT%Ot!o=sv(XS28<$7c4J}3D@_|mqxr{Rn2N_Ni;zF8Z$W06|Lq@1~ZP%4`a(yAW(vIhkHnJ+gHdPhjbQG~t!h#c_p;u3C#;wrYv;Ajg zPH)JMB*8v*6>+;7p~zG&zt?;|-V*9xzV|bH6$E?UjnG80tL?-4_2C~UI^@Nf@B2Wo zcR3z@e9_Z8aIN;(t;tLI?%gs7_M!)&PmLSRzTrEa(=V4+J( z8+yhhIMy>3)>t%w$!}*hRK4cTcO0u?N9k}!kPvMQq;lo;dc{|&+;D(nV2e@y!{|YU zlWVy{s(eHZB~g`O$`nRR8bDd}Gz9``K#6VAq_XC2ie!ycObrA?V`*z+w?-*uROnmU z)|Gei-bt#YHLEi5dXNtCwNp&H5VMaElN2L~vM~2zRUSJa@D|MF?yfYZRMTGH;F$O3M&3VjQt75EZVNBy1^3Jh!Qo^ zs+QA|RArUzY9wVw)Liqpbyin$m{8v2oO-e^c%;8iNykJ#EtN7y_@Oy1mBm!CL)szj ukakErq#e=@`4=G_h~E`brml0%;79Yz6u&S0Uo-fZL;eD?^C3fc3;+OMtybOu literal 296 zcmV+@0oVRPRzVJu00000000A1 zU|?WiWRNW1&RF-Nsp5?!+Y^b*wxx^=AW#IPm>Jl?Y(@@7W+NbN0mNZIEX>Fz$jIiO zl$DxX!pI0`3J3@=F!C}mGBGgnF)}s)6^bx2Gcd9WGV-Kl=A;HBmXxFx)Bxj@+AyjfOvRnhIyaU8Pz&fCovpN!?T3TR(na~a9Oe`)=Ehz@eqZum*(+M;?t5`2Lu>b(aq}^7M0RRBxhj_;T diff --git a/test/snapshots/protocol-ava-3.js.md b/test/snapshots/protocol-ava-3.js.md deleted file mode 100644 index 43ba7b2..0000000 --- a/test/snapshots/protocol-ava-3.js.md +++ /dev/null @@ -1,91 +0,0 @@ -# Snapshot report for `test/protocol-ava-3.js` - -The actual snapshot is saved in `protocol-ava-3.js.snap`. - -Generated by [AVA](https://avajs.dev). - -## main() config validation: config may not be an empty object - -> Snapshot 1 - - Error { - message: 'Unexpected Typescript configuration for AVA. See https://github.com/avajs/typescript/blob/v${pkg.version}/README.md for allowed values.', - } - -## main() config validation: rewrite paths must end in a / - -> Snapshot 1 - - Error { - message: 'Unexpected Typescript configuration for AVA. See https://github.com/avajs/typescript/blob/v${pkg.version}/README.md for allowed values.', - } - -> Snapshot 2 - - Error { - message: 'Unexpected Typescript configuration for AVA. See https://github.com/avajs/typescript/blob/v${pkg.version}/README.md for allowed values.', - } - -## main() config validation: throw when config contains keys other than 'extensions' or 'rewritePaths' - -> Snapshot 1 - - Error { - message: 'Unexpected Typescript configuration for AVA. See https://github.com/avajs/typescript/blob/v${pkg.version}/README.md for allowed values.', - } - -## main() config validation: throw when config is not a plain object - -> Snapshot 1 - - Error { - message: 'Unexpected Typescript configuration for AVA. See https://github.com/avajs/typescript/blob/v${pkg.version}/README.md for allowed values.', - } - -> Snapshot 2 - - Error { - message: 'Unexpected Typescript configuration for AVA. See https://github.com/avajs/typescript/blob/v${pkg.version}/README.md for allowed values.', - } - -> Snapshot 3 - - Error { - message: 'Unexpected Typescript configuration for AVA. See https://github.com/avajs/typescript/blob/v${pkg.version}/README.md for allowed values.', - } - -> Snapshot 4 - - Error { - message: 'Unexpected Typescript configuration for AVA. See https://github.com/avajs/typescript/blob/v${pkg.version}/README.md for allowed values.', - } - -## main() config validation: throw when config.extensions contains duplicates - -> Snapshot 1 - - Error { - message: 'Unexpected Typescript configuration for AVA. See https://github.com/avajs/typescript/blob/v${pkg.version}/README.md for allowed values.', - } - -## main() config validation: throw when config.extensions contains empty strings - -> Snapshot 1 - - Error { - message: 'Unexpected Typescript configuration for AVA. See https://github.com/avajs/typescript/blob/v${pkg.version}/README.md for allowed values.', - } - -## main() config validation: throw when config.extensions contains non-strings - -> Snapshot 1 - - Error { - message: 'Unexpected Typescript configuration for AVA. See https://github.com/avajs/typescript/blob/v${pkg.version}/README.md for allowed values.', - } - -## worker(): load rewritten paths files - -> Snapshot 1 - - 'logged in file.js' diff --git a/test/snapshots/protocol-ava-3.js.snap b/test/snapshots/protocol-ava-3.js.snap deleted file mode 100644 index 35da63a659bef20a1e9520489a35b29d70dd71a7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 494 zcmVzN>U3Nr(P_15 zAR~KjYH@L5dMcF9)Xor^ms(Mfnp~2aq7YJ9kXoEvlvz-sker{FmYH5!lvt9PpQn(P zU!>p|=BTF-oSLeTQBqP+Y^ATCo>`JnnxvPUpR1o(mY7wnUjo;zpOllIq+g~|U67rw zSC(2-3^b%xKgiY5#n)9YHwA27VopweIndIw#GKO9V!csMj(T#`lcSy-_2j50M?E>} k$r0p9Rt7;v!JPc`bf8=&(CW;bRK2WX0I&pHj_e8m0O4WldjJ3c From 869760a149ea3bafd86829b1956646deec86ff1d Mon Sep 17 00:00:00 2001 From: Szymon Marczak <36894700+szmarczak@users.noreply.github.com> Date: Mon, 12 Apr 2021 10:32:03 +0200 Subject: [PATCH 4/5] Add `compile` option Support compilation using `tsc` before AVA runs tests. This is a breaking change. To retain the old behavior you must configure `compile: false`. Co-authored-by: Mark Wubben --- .editorconfig | 3 + .gitignore | 2 + README.md | 11 ++- index.js | 92 +++++++++++++----- package.json | 15 ++- test/_with-provider.js | 23 +++++ test/broken-fixtures/tsconfig.json | 8 ++ test/broken-fixtures/typescript/typescript.ts | 1 + test/compilation.js | 61 ++++++++++++ test/fixtures/install-and-load.js | 6 +- test/fixtures/tsconfig.json | 8 ++ test/fixtures/{ => typescript}/file.js | 0 test/fixtures/typescript/index.ts | 1 + test/protocol-ava-3.2.js | 72 ++++---------- test/snapshots/compilation.js.md | 24 +++++ test/snapshots/compilation.js.snap | Bin 0 -> 284 bytes test/snapshots/protocol-ava-3.2.js.md | 44 +++++---- test/snapshots/protocol-ava-3.2.js.snap | Bin 712 -> 738 bytes 18 files changed, 264 insertions(+), 107 deletions(-) create mode 100644 test/_with-provider.js create mode 100644 test/broken-fixtures/tsconfig.json create mode 100644 test/broken-fixtures/typescript/typescript.ts create mode 100644 test/compilation.js create mode 100644 test/fixtures/tsconfig.json rename test/fixtures/{ => typescript}/file.js (100%) create mode 100644 test/fixtures/typescript/index.ts create mode 100644 test/snapshots/compilation.js.md create mode 100644 test/snapshots/compilation.js.snap diff --git a/.editorconfig b/.editorconfig index 1c6314a..c888938 100644 --- a/.editorconfig +++ b/.editorconfig @@ -10,3 +10,6 @@ insert_final_newline = true [*.yml] indent_style = space indent_size = 2 + +[package.json] +indent_style = space diff --git a/.gitignore b/.gitignore index ccc2930..ff9a350 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ /coverage /node_modules +/test/fixtures/typescript/compiled +/test/broken-fixtures/typescript/compiled diff --git a/README.md b/README.md index a14ec94..4466038 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # @ava/typescript -Adds rudimentary [TypeScript](https://www.typescriptlang.org/) support to [AVA](https://avajs.dev). +Adds [TypeScript](https://www.typescriptlang.org/) support to [AVA](https://avajs.dev). -This is designed to work for projects that precompile their TypeScript code, including tests. It allows AVA to load the resulting JavaScript, while configuring AVA to use the TypeScript paths. +This is designed to work for projects that precompile TypeScript. It allows AVA to load the compiled JavaScript, while configuring AVA to treat the TypeScript files as test files. -In other words, say you have a test file at `src/test.ts`. You've configured TypeScript to output to `build/`. Using `@ava/typescript` you can run the `build/test.js` file using `npx ava src/test.ts`. AVA won't pick up any of the JavaScript files present in the `build/` directory, unless they have a TypeScript counterpart in `src/`. +In other words, say you have a test file at `src/test.ts`. You've configured TypeScript to output to `build/`. Using `@ava/typescript` you can run the test using `npx ava src/test.ts`. ## Enabling TypeScript support @@ -24,7 +24,8 @@ Then, enable TypeScript support either in `package.json` or `ava.config.*`: "typescript": { "rewritePaths": { "src/": "build/" - } + }, + "compile": false } } } @@ -32,6 +33,8 @@ Then, enable TypeScript support either in `package.json` or `ava.config.*`: Both keys and values of the `rewritePaths` object must end with a `/`. Paths are relative to your project directory. +You can enable compilation via the `compile` property. If `false`, AVA will assume you have already compiled your project. If set to `'tsc'`, AVA will run the TypeScript compiler before running your tests. This can be inefficient when using AVA in watch mode. + Output files are expected to have the `.js` extension. AVA searches your entire project for `*.js`, `*.cjs`, `*.mjs` and `*.ts` files (or other extensions you've configured). It will ignore such files found in the `rewritePaths` targets (e.g. `build/`). If you use more specific paths, for instance `build/main/`, you may need to change AVA's `files` configuration to ignore other directories. diff --git a/index.js b/index.js index c48265e..8fc5369 100644 --- a/index.js +++ b/index.js @@ -1,31 +1,74 @@ 'use strict'; const path = require('path'); - const escapeStringRegexp = require('escape-string-regexp'); - +const execa = require('execa'); const pkg = require('./package.json'); +const help = `See https://github.com/avajs/typescript/blob/v${pkg.version}/README.md`; + function isPlainObject(x) { return x !== null && typeof x === 'object' && Reflect.getPrototypeOf(x) === Object.prototype; } -function isValidExtensions(extensions) { - return Array.isArray(extensions) && - extensions.length > 0 && - extensions.every(ext => typeof ext === 'string' && ext !== '') && - new Set(extensions).size === extensions.length; -} +function validate(target, properties) { + for (const key of Object.keys(properties)) { + const {required, isValid} = properties[key]; + const missing = !Reflect.has(target, key); -function isValidRewritePaths(rewritePaths) { - if (!isPlainObject(rewritePaths)) { - return false; + if (missing) { + if (required) { + throw new Error(`Missing '${key}' property in TypeScript configuration for AVA. ${help}`); + } + + continue; + } + + if (!isValid(target[key])) { + throw new Error(`Invalid '${key}' property in TypeScript configuration for AVA. ${help}`); + } + } + + for (const key of Object.keys(target)) { + if (!Reflect.has(properties, key)) { + throw new Error(`Unexpected '${key}' property in TypeScript configuration for AVA. ${help}`); + } } +} - return Object.entries(rewritePaths).every(([from, to]) => { - return from.endsWith('/') && typeof to === 'string' && to.endsWith('/'); - }); +async function compileTypeScript(projectDir) { + return execa('tsc', ['--incremental'], {preferLocal: true, cwd: projectDir}); } +const configProperties = { + compile: { + required: true, + isValid(compile) { + return compile === false || compile === 'tsc'; + } + }, + rewritePaths: { + required: true, + isValid(rewritePaths) { + if (!isPlainObject(rewritePaths)) { + return false; + } + + return Object.entries(rewritePaths).every(([from, to]) => { + return from.endsWith('/') && typeof to === 'string' && to.endsWith('/'); + }); + } + }, + extensions: { + required: false, + isValid(extensions) { + return Array.isArray(extensions) && + extensions.length > 0 && + extensions.every(ext => typeof ext === 'string' && ext !== '') && + new Set(extensions).size === extensions.length; + } + } +}; + module.exports = ({negotiateProtocol}) => { const protocol = negotiateProtocol(['ava-3.2'], {version: pkg.version}); if (protocol === null) { @@ -34,23 +77,16 @@ module.exports = ({negotiateProtocol}) => { return { main({config}) { - let valid = false; - if (isPlainObject(config)) { - const keys = Object.keys(config); - if (keys.every(key => key === 'extensions' || key === 'rewritePaths')) { - valid = - (config.extensions === undefined || isValidExtensions(config.extensions)) && - isValidRewritePaths(config.rewritePaths); - } + if (!isPlainObject(config)) { + throw new Error(`Unexpected Typescript configuration for AVA. ${help}`); } - if (!valid) { - throw new Error(`Unexpected Typescript configuration for AVA. See https://github.com/avajs/typescript/blob/v${pkg.version}/README.md for allowed values.`); - } + validate(config, configProperties); const { extensions = ['ts'], - rewritePaths: relativeRewritePaths + rewritePaths: relativeRewritePaths, + compile } = config; const rewritePaths = Object.entries(relativeRewritePaths).map(([from, to]) => [ @@ -61,6 +97,10 @@ module.exports = ({negotiateProtocol}) => { return { async compile() { + if (compile === 'tsc') { + await compileTypeScript(protocol.projectDir); + } + return { extensions: extensions.slice(), rewritePaths: rewritePaths.slice() diff --git a/package.json b/package.json index 228b04a..aa16b47 100644 --- a/package.json +++ b/package.json @@ -19,12 +19,14 @@ "test": "xo && c8 ava" }, "dependencies": { - "escape-string-regexp": "^4.0.0" + "escape-string-regexp": "^4.0.0", + "execa": "^5.0.0" }, "devDependencies": { "ava": "^3.15.0", "c8": "^7.7.1", - "execa": "^5.0.0", + "del": "^6.0.0", + "typescript": "^4.2.4", "xo": "^0.38.2" }, "c8": { @@ -34,7 +36,16 @@ "text" ] }, + "ava": { + "files": [ + "!test/broken-fixtures/**" + ], + "timeout": "60s" + }, "xo": { + "ignores": [ + "test/broken-fixtures" + ], "rules": { "import/order": "off" } diff --git a/test/_with-provider.js b/test/_with-provider.js new file mode 100644 index 0000000..9bc8089 --- /dev/null +++ b/test/_with-provider.js @@ -0,0 +1,23 @@ +const path = require('path'); +const pkg = require('../package.json'); +const makeProvider = require('..'); + +const createProviderMacro = (identifier, avaVersion, projectDir = __dirname) => { + return (t, run) => run(t, makeProvider({ + negotiateProtocol(identifiers, {version}) { + t.true(identifiers.includes(identifier)); + t.is(version, pkg.version); + return { + ava: {avaVersion}, + identifier, + normalizeGlobPatterns: patterns => patterns, + async findFiles({patterns}) { + return patterns.map(file => path.join(projectDir, file)); + }, + projectDir + }; + } + })); +}; + +module.exports = createProviderMacro; diff --git a/test/broken-fixtures/tsconfig.json b/test/broken-fixtures/tsconfig.json new file mode 100644 index 0000000..47d862c --- /dev/null +++ b/test/broken-fixtures/tsconfig.json @@ -0,0 +1,8 @@ +{ + "compilerOptions": { + "outDir": "typescript/compiled" + }, + "include": [ + "typescript" + ] +} diff --git a/test/broken-fixtures/typescript/typescript.ts b/test/broken-fixtures/typescript/typescript.ts new file mode 100644 index 0000000..7898192 --- /dev/null +++ b/test/broken-fixtures/typescript/typescript.ts @@ -0,0 +1 @@ +a diff --git a/test/compilation.js b/test/compilation.js new file mode 100644 index 0000000..0a791dd --- /dev/null +++ b/test/compilation.js @@ -0,0 +1,61 @@ +const path = require('path'); +const test = require('ava'); +const del = require('del'); +const execa = require('execa'); +const createProviderMacro = require('./_with-provider'); + +const withProvider = createProviderMacro('ava-3.2', '3.2.0', path.join(__dirname, 'fixtures')); +const withAltProvider = createProviderMacro('ava-3.2', '3.2.0', path.join(__dirname, 'broken-fixtures')); + +test.before('deleting compiled files', async t => { + t.log(await del('test/fixtures/typescript/compiled')); + t.log(await del('test/broken-fixtures/typescript/compiled')); +}); + +const compile = async provider => { + return { + state: await provider.main({ + config: { + rewritePaths: { + 'ts/': 'typescript/', + 'compiled/': 'typescript/compiled/' + }, + compile: 'tsc' + } + }).compile() + }; +}; + +test('worker(): load rewritten paths files', withProvider, async (t, provider) => { + const {state} = await compile(provider); + const {stdout, stderr} = await execa.node( + path.join(__dirname, 'fixtures/install-and-load'), + [JSON.stringify(state), path.join(__dirname, 'fixtures/ts', 'file.ts')], + {cwd: path.join(__dirname, 'fixtures')} + ); + if (stderr.length > 0) { + t.log(stderr); + } + + t.snapshot(stdout); +}); + +test('worker(): runs compiled files', withProvider, async (t, provider) => { + const {state} = await compile(provider); + const {stdout, stderr} = await execa.node( + path.join(__dirname, 'fixtures/install-and-load'), + [JSON.stringify(state), path.join(__dirname, 'fixtures/compiled', 'index.ts')], + {cwd: path.join(__dirname, 'fixtures')} + ); + if (stderr.length > 0) { + t.log(stderr); + } + + t.snapshot(stdout); +}); + +test('compile() error', withAltProvider, async (t, provider) => { + const {message} = await t.throwsAsync(compile(provider)); + + t.snapshot(message); +}); diff --git a/test/fixtures/install-and-load.js b/test/fixtures/install-and-load.js index fce29b1..5e1f26c 100644 --- a/test/fixtures/install-and-load.js +++ b/test/fixtures/install-and-load.js @@ -3,16 +3,16 @@ const makeProvider = require('../..'); const provider = makeProvider({ negotiateProtocol() { - return {identifier: process.argv[2], ava: {version: '3.0.0'}, projectDir: path.resolve(__dirname, '..')}; + return {identifier: 'ava-3.2', ava: {version: '3.15.0'}, projectDir: __dirname}; } }); const worker = provider.worker({ extensionsToLoadAsModules: [], - state: JSON.parse(process.argv[3]) + state: JSON.parse(process.argv[2]) }); -const ref = path.resolve(process.argv[4]); +const ref = path.resolve(process.argv[3]); if (worker.canLoad(ref)) { worker.load(ref, {requireFn: require}); diff --git a/test/fixtures/tsconfig.json b/test/fixtures/tsconfig.json new file mode 100644 index 0000000..47d862c --- /dev/null +++ b/test/fixtures/tsconfig.json @@ -0,0 +1,8 @@ +{ + "compilerOptions": { + "outDir": "typescript/compiled" + }, + "include": [ + "typescript" + ] +} diff --git a/test/fixtures/file.js b/test/fixtures/typescript/file.js similarity index 100% rename from test/fixtures/file.js rename to test/fixtures/typescript/file.js diff --git a/test/fixtures/typescript/index.ts b/test/fixtures/typescript/index.ts new file mode 100644 index 0000000..1bc76e0 --- /dev/null +++ b/test/fixtures/typescript/index.ts @@ -0,0 +1 @@ +console.log('logged in fixtures/typescript/index.ts'); diff --git a/test/protocol-ava-3.2.js b/test/protocol-ava-3.2.js index 82d41d0..476895f 100644 --- a/test/protocol-ava-3.2.js +++ b/test/protocol-ava-3.2.js @@ -1,24 +1,9 @@ const path = require('path'); const test = require('ava'); -const execa = require('execa'); const pkg = require('../package.json'); -const makeProvider = require('..'); - -const withProvider = (t, run) => run(t, makeProvider({ - negotiateProtocol(identifiers, {version}) { - t.true(identifiers.includes('ava-3.2')); - t.is(version, pkg.version); - return { - ava: {version: '3.15.0'}, - identifier: 'ava-3.2', - normalizeGlobPatterns: patterns => patterns, - async findFiles({patterns}) { - return patterns.map(file => path.join(__dirname, file)); - }, - projectDir: __dirname - }; - } -})); +const createProviderMacro = require('./_with-provider'); + +const withProvider = createProviderMacro('ava-3.2', '3.15.0'); const validateConfig = (t, provider, config) => { const error = t.throws(() => provider.main({config})); @@ -35,8 +20,8 @@ test('main() config validation: throw when config is not a plain object', withPr validateConfig(t, provider, []); }); -test('main() config validation: throw when config contains keys other than \'extensions\' or \'rewritePaths\'', withProvider, (t, provider) => { - validateConfig(t, provider, {foo: 1}); +test('main() config validation: throw when config contains keys other than \'extensions\', \'rewritePaths\' or \'compile\'', withProvider, (t, provider) => { + validateConfig(t, provider, {compile: false, foo: 1, rewritePaths: {'src/': 'build/'}}); }); test('main() config validation: throw when config.extensions contains empty strings', withProvider, (t, provider) => { @@ -55,68 +40,47 @@ test('main() config validation: config may not be an empty object', withProvider validateConfig(t, provider, {}); }); +test('main() config validation: throw when config.compile is invalid', withProvider, (t, provider) => { + validateConfig(t, provider, {rewritePaths: {'src/': 'build/'}, compile: 1}); + validateConfig(t, provider, {rewritePaths: {'src/': 'build/'}, compile: undefined}); +}); + test('main() config validation: rewrite paths must end in a /', withProvider, (t, provider) => { - validateConfig(t, provider, {rewritePaths: {src: 'build/'}}); - validateConfig(t, provider, {rewritePaths: {'src/': 'build'}}); + validateConfig(t, provider, {rewritePaths: {src: 'build/', compile: false}}); + validateConfig(t, provider, {rewritePaths: {'src/': 'build', compile: false}}); }); test('main() extensions: defaults to [\'ts\']', withProvider, (t, provider) => { - t.deepEqual(provider.main({config: {rewritePaths: {'src/': 'build/'}}}).extensions, ['ts']); + t.deepEqual(provider.main({config: {rewritePaths: {'src/': 'build/'}, compile: false}}).extensions, ['ts']); }); test('main() extensions: returns configured extensions', withProvider, (t, provider) => { const extensions = ['tsx']; - t.deepEqual(provider.main({config: {extensions, rewritePaths: {'src/': 'build/'}}}).extensions, extensions); + t.deepEqual(provider.main({config: {extensions, rewritePaths: {'src/': 'build/'}, compile: false}}).extensions, extensions); }); test('main() extensions: always returns new arrays', withProvider, (t, provider) => { - const main = provider.main({config: {rewritePaths: {'src/': 'build/'}}}); + const main = provider.main({config: {rewritePaths: {'src/': 'build/'}, compile: false}}); t.not(main.extensions, main.extensions); }); test('main() ignoreChange()', withProvider, (t, provider) => { - const main = provider.main({config: {rewritePaths: {'src/': 'build/'}}}); + const main = provider.main({config: {rewritePaths: {'src/': 'build/'}, compile: false}}); t.true(main.ignoreChange(path.join(__dirname, 'src/foo.ts'))); t.false(main.ignoreChange(path.join(__dirname, 'build/foo.js'))); }); test('main() resolveTestfile()', withProvider, (t, provider) => { - const main = provider.main({config: {rewritePaths: {'src/': 'build/'}}}); + const main = provider.main({config: {rewritePaths: {'src/': 'build/'}, compile: false}}); t.is(main.resolveTestFile(path.join(__dirname, 'src/foo.ts')), path.join(__dirname, 'build/foo.js')); t.is(main.resolveTestFile(path.join(__dirname, 'build/foo.js')), path.join(__dirname, 'build/foo.js')); t.is(main.resolveTestFile(path.join(__dirname, 'foo/bar.ts')), path.join(__dirname, 'foo/bar.ts')); }); test('main() updateGlobs()', withProvider, (t, provider) => { - const main = provider.main({config: {rewritePaths: {'src/': 'build/'}}}); + const main = provider.main({config: {rewritePaths: {'src/': 'build/'}, compile: false}}); t.snapshot(main.updateGlobs({ filePatterns: ['src/test.ts'], ignoredByWatcherPatterns: ['assets/**'] })); }); - -const compile = async provider => { - return { - state: await provider.main({ - config: { - rewritePaths: { - 'typescript/': 'fixtures/' - } - } - }).compile() - }; -}; - -test('worker(): load rewritten paths files', withProvider, async (t, provider) => { - const {state} = await compile(provider); - const {stdout, stderr} = await execa.node( - path.join(__dirname, 'fixtures/install-and-load'), - ['ava-3', JSON.stringify(state), path.join(__dirname, 'typescript', 'file.ts')], - {cwd: path.join(__dirname, 'fixtures')} - ); - if (stderr.length > 0) { - t.log(stderr); - } - - t.snapshot(stdout); -}); diff --git a/test/snapshots/compilation.js.md b/test/snapshots/compilation.js.md new file mode 100644 index 0000000..1b54123 --- /dev/null +++ b/test/snapshots/compilation.js.md @@ -0,0 +1,24 @@ +# Snapshot report for `test/compilation.js` + +The actual snapshot is saved in `compilation.js.snap`. + +Generated by [AVA](https://avajs.dev). + +## worker(): load rewritten paths files + +> Snapshot 1 + + 'logged in file.js' + +## worker(): runs compiled files + +> Snapshot 1 + + 'logged in fixtures/typescript/index.ts' + +## compile() error + +> Snapshot 1 + + `Command failed with exit code 2: tsc --incremental␊ + typescript/typescript.ts(1,1): error TS2304: Cannot find name 'a'.` diff --git a/test/snapshots/compilation.js.snap b/test/snapshots/compilation.js.snap new file mode 100644 index 0000000000000000000000000000000000000000..1d4c4eda42693aee7cdbddc2638609b68826f39e GIT binary patch literal 284 zcmV+%0ptEbRzVmQ2<000000009E zVPIfjX7DZG_h>lz^`yk==h7;_AHHW~009#quFJABdvy0#)aO7O=8IE4XflFDgMoPE zxvtXB_X7B~Tdj6jbo}T}MzH8LuzBoY{fw*(f{bc8`RVDYDGHf+3Tc@YC8b5F#rh?c z1*yf!MVSR9`k8qtsTF!9#VC3Nk@e)H>SduympbR?<|gK)D5NC6iSMd6?Ano^OB2Fb5rw55_7natVA$@_G%dF7;0K6q!tzB7b%1U8yOpz iSSdIs=H=y=0PP0ak(Zd8s-T{zt_J`Mn{bIL0RR9UyMMj_ literal 0 HcmV?d00001 diff --git a/test/snapshots/protocol-ava-3.2.js.md b/test/snapshots/protocol-ava-3.2.js.md index 98cbcff..89878f9 100644 --- a/test/snapshots/protocol-ava-3.2.js.md +++ b/test/snapshots/protocol-ava-3.2.js.md @@ -9,33 +9,33 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 Error { - message: 'Unexpected Typescript configuration for AVA. See https://github.com/avajs/typescript/blob/v${pkg.version}/README.md for allowed values.', + message: 'Unexpected Typescript configuration for AVA. See https://github.com/avajs/typescript/blob/v${pkg.version}/README.md', } > Snapshot 2 Error { - message: 'Unexpected Typescript configuration for AVA. See https://github.com/avajs/typescript/blob/v${pkg.version}/README.md for allowed values.', + message: 'Unexpected Typescript configuration for AVA. See https://github.com/avajs/typescript/blob/v${pkg.version}/README.md', } > Snapshot 3 Error { - message: 'Unexpected Typescript configuration for AVA. See https://github.com/avajs/typescript/blob/v${pkg.version}/README.md for allowed values.', + message: 'Unexpected Typescript configuration for AVA. See https://github.com/avajs/typescript/blob/v${pkg.version}/README.md', } > Snapshot 4 Error { - message: 'Unexpected Typescript configuration for AVA. See https://github.com/avajs/typescript/blob/v${pkg.version}/README.md for allowed values.', + message: 'Unexpected Typescript configuration for AVA. See https://github.com/avajs/typescript/blob/v${pkg.version}/README.md', } -## main() config validation: throw when config contains keys other than 'extensions' or 'rewritePaths' +## main() config validation: throw when config contains keys other than 'extensions', 'rewritePaths' or 'compile' > Snapshot 1 Error { - message: 'Unexpected Typescript configuration for AVA. See https://github.com/avajs/typescript/blob/v${pkg.version}/README.md for allowed values.', + message: 'Unexpected \'foo\' property in TypeScript configuration for AVA. See https://github.com/avajs/typescript/blob/v${pkg.version}/README.md', } ## main() config validation: throw when config.extensions contains empty strings @@ -43,7 +43,7 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 Error { - message: 'Unexpected Typescript configuration for AVA. See https://github.com/avajs/typescript/blob/v${pkg.version}/README.md for allowed values.', + message: 'Missing \'compile\' property in TypeScript configuration for AVA. See https://github.com/avajs/typescript/blob/v${pkg.version}/README.md', } ## main() config validation: throw when config.extensions contains non-strings @@ -51,7 +51,7 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 Error { - message: 'Unexpected Typescript configuration for AVA. See https://github.com/avajs/typescript/blob/v${pkg.version}/README.md for allowed values.', + message: 'Missing \'compile\' property in TypeScript configuration for AVA. See https://github.com/avajs/typescript/blob/v${pkg.version}/README.md', } ## main() config validation: throw when config.extensions contains duplicates @@ -59,7 +59,7 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 Error { - message: 'Unexpected Typescript configuration for AVA. See https://github.com/avajs/typescript/blob/v${pkg.version}/README.md for allowed values.', + message: 'Missing \'compile\' property in TypeScript configuration for AVA. See https://github.com/avajs/typescript/blob/v${pkg.version}/README.md', } ## main() config validation: config may not be an empty object @@ -67,7 +67,21 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 Error { - message: 'Unexpected Typescript configuration for AVA. See https://github.com/avajs/typescript/blob/v${pkg.version}/README.md for allowed values.', + message: 'Missing \'compile\' property in TypeScript configuration for AVA. See https://github.com/avajs/typescript/blob/v${pkg.version}/README.md', + } + +## main() config validation: throw when config.compile is invalid + +> Snapshot 1 + + Error { + message: 'Invalid \'compile\' property in TypeScript configuration for AVA. See https://github.com/avajs/typescript/blob/v${pkg.version}/README.md', + } + +> Snapshot 2 + + Error { + message: 'Invalid \'compile\' property in TypeScript configuration for AVA. See https://github.com/avajs/typescript/blob/v${pkg.version}/README.md', } ## main() config validation: rewrite paths must end in a / @@ -75,13 +89,13 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 Error { - message: 'Unexpected Typescript configuration for AVA. See https://github.com/avajs/typescript/blob/v${pkg.version}/README.md for allowed values.', + message: 'Missing \'compile\' property in TypeScript configuration for AVA. See https://github.com/avajs/typescript/blob/v${pkg.version}/README.md', } > Snapshot 2 Error { - message: 'Unexpected Typescript configuration for AVA. See https://github.com/avajs/typescript/blob/v${pkg.version}/README.md for allowed values.', + message: 'Missing \'compile\' property in TypeScript configuration for AVA. See https://github.com/avajs/typescript/blob/v${pkg.version}/README.md', } ## main() updateGlobs() @@ -99,9 +113,3 @@ Generated by [AVA](https://avajs.dev). 'build/**/*.js.map', ], } - -## worker(): load rewritten paths files - -> Snapshot 1 - - 'logged in file.js' diff --git a/test/snapshots/protocol-ava-3.2.js.snap b/test/snapshots/protocol-ava-3.2.js.snap index b76e02de8b92142378fb21b375ac4bfc6536573b..1e9982c6d786e2920d8fc33c830852e8b9ff307d 100644 GIT binary patch literal 738 zcmV<80v-K9RzVj?;UkBm^u!n(^p$jIx&*9QE2e>E!;tfMT4nLI|zbI90uzv=NCF)K9rc>9U# zM;7G=l3tzR>tzt^R3$<+ zIx$vy8MA1Es>XHJ+ZPT*%#^C7wFFfeFQ=kh4JXa8nywwNPR0XiOek-1M(t<~?rm!g zq@sV);xKB{DbM2Q5=518F$xRtzGF4Dnu)IX{8wuvM?1_^HPYFxl3MRcK7Yb~Gw|_#^L^j@z4?A~c|JhM zjT%Ot!o=sv(XS28<$7c4J}3D@_|mqxr{Rn2N_Ni;zF8Z$W06|Lq@1~ZP%4`a(yAW(vIhkHnJ+gHdPhjbQG~t!h#c_p;u3C#;wrYv;Ajg zPH)JMB*8v*6>+;7p~zG&zt?;|-V*9xzV|bH6$E?UjnG80tL?-4_2C~UI^@Nf@B2Wo zcR3z@e9_Z8aIN;(t;tLI?%gs7_M!)&PmLSRzTrEa(=V4+J( z8+yhhIMy>3)>t%w$!}*hRK4cTcO0u?N9k}!kPvMQq;lo;dc{|&+;D(nV2e@y!{|YU zlWVy{s(eHZB~g`O$`nRR8bDd}Gz9``K#6VAq_XC2ie!ycObrA?V`*z+w?-*uROnmU z)|Gei-bt#YHLEi5dXNtCwNp&H5VMaElN2L~vM~2zRUSJa@D|MF?yfYZRMTGH;F$O3M&3VjQt75EZVNBy1^3Jh!Qo^ zs+QA|RArUzY9wVw)Liqpbyin$m{8v2oO-e^c%;8iNykJ#EtN7y_@Oy1mBm!CL)szj ukakErq#e=@`4=G_h~E`brml0%;79Yz6u&S0Uo-fZL;eD?^C3fc3;+OMtybOu From b6bc75786716cc54040582b1f42e716046347ad8 Mon Sep 17 00:00:00 2001 From: Mark Wubben Date: Mon, 12 Apr 2021 10:33:42 +0200 Subject: [PATCH 5/5] 2.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index aa16b47..c88c33c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ava/typescript", - "version": "1.1.1", + "version": "2.0.0", "description": "TypeScript provider for AVA", "engines": { "node": ">=12.22 <13 || >=14.16 <15 || >=15"