Skip to content

Commit

Permalink
Fix ava + .ts for node 20
Browse files Browse the repository at this point in the history
See avajs/ava#2593 (comment)

This fixes:

```
./node_modules/.bin/ava

(node:605416) ExperimentalWarning: Custom ESM Loaders is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
  Uncaught exception in tests/session_test.ts

  TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for code/websites/cards/tests/session_test.ts

  ✘ tests/session_test.ts exited with a non-zero exit code: 1
  ─

  1 uncaught exception
```
  • Loading branch information
ivan committed Jul 16, 2023
1 parent d9df341 commit 629aef5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions package.json
Expand Up @@ -5,7 +5,7 @@
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"test": "./node_modules/.bin/ava && ./node_modules/.bin/tsc --target esnext --moduleResolution node --noEmit tests/*.ts && ./node_modules/.bin/eslint .",
"test": "NODE_OPTIONS='--loader=tsx' ./node_modules/.bin/ava && ./node_modules/.bin/tsc --target esnext --moduleResolution node --noEmit tests/*.ts && ./node_modules/.bin/eslint .",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --plugin-search-dir . --check . && eslint .",
Expand Down Expand Up @@ -55,8 +55,7 @@
"ava": {
"extensions": {
"ts": "module"
},
"nodeArguments": ["--loader=tsx"]
}
},
"pnpm": {
"overrides": {
Expand Down

0 comments on commit 629aef5

Please sign in to comment.