From 84f53ebdb5dadb38ea1ea6ea7b26e804e4f3b797 Mon Sep 17 00:00:00 2001 From: Adam Lynch Date: Thu, 23 Apr 2020 16:41:22 +0100 Subject: [PATCH 1/4] README: pointing out that ES modules aren't supported yet Related to https://github.com/avajs/typescript/issues/5 --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index c403a50..c98e125 100644 --- a/README.md +++ b/README.md @@ -61,3 +61,8 @@ You can configure AVA to recognize additional file extensions. To add (partial See also AVA's [`extensions` option](https://github.com/avajs/ava/blob/master/docs/06-configuration.md#options). † Note that the [*preserve* mode for JSX](https://www.typescriptlang.org/docs/handbook/jsx.html) is not (yet) supported. + + +## ES modules + +Importing ES modules is not supported yet. You must use `require` for now. See issue [#5](https://github.com/avajs/typescript/issues/5) From beba4a5d13adc46fd025dfd8b4086d9d7cdb470c Mon Sep 17 00:00:00 2001 From: Adam Lynch Date: Sat, 2 May 2020 11:44:53 +0100 Subject: [PATCH 2/4] Point out that tests are precompiled instead --- README.md | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/README.md b/README.md index c98e125..c8debb5 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ 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 TypeScript (including tests). 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 test using `npx ava src/test.ts`. @@ -61,8 +61,3 @@ You can configure AVA to recognize additional file extensions. To add (partial See also AVA's [`extensions` option](https://github.com/avajs/ava/blob/master/docs/06-configuration.md#options). † Note that the [*preserve* mode for JSX](https://www.typescriptlang.org/docs/handbook/jsx.html) is not (yet) supported. - - -## ES modules - -Importing ES modules is not supported yet. You must use `require` for now. See issue [#5](https://github.com/avajs/typescript/issues/5) From 983ef8bc48c0c73acfcdec950254e01d5d70a9b3 Mon Sep 17 00:00:00 2001 From: Mark Wubben Date: Sat, 2 May 2020 13:01:24 +0200 Subject: [PATCH 3/4] Improve description of how this package makes AVA behave --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c8debb5..f8e22a4 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 (including tests). 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 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 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 486a52245021357903555779afd331cfa3cfb8ec Mon Sep 17 00:00:00 2001 From: Mark Wubben Date: Sat, 2 May 2020 15:12:23 +0200 Subject: [PATCH 4/4] paths --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f8e22a4..a14ec94 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Adds rudimentary [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 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 `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/`.