Skip to content

Commit

Permalink
Fix prebuilding of test files
Browse files Browse the repository at this point in the history
  • Loading branch information
tolauwae committed Dec 6, 2024
1 parent 528e574 commit cfa5b3c
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 22 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ dist/
# IDE folders
.idea

# built ava test files
out

# c8 Coverage
coverage
out
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"build:cjs": "tsc --project tsconfig.build.json --module commonjs --outDir dist/cjs && npx convert-extension cjs dist/cjs/ && rm -f dist/cjs/*.map",
"watch": "tsc -watch -p ./",
"lint": "eslint src/**/* --config .eslint.config.mjs",
"test:all": "npx ts-node tests/test.ts && npm run test:ava",
"test:prebuild": "npm run build && npx tsc tests/unit/* --outDir out",
"test:all": "npm run test:prebuild && npm run test:ava",
"test:ava": "ava",
"test:coverage": "c8 --src src/ --all ava"
},
Expand Down Expand Up @@ -52,7 +53,7 @@
},
"ava": {
"files": [
"out/tests/unit.js"
"out/tests/unit/interface.js"
],
"typescript": {
"compile": "tsc",
Expand Down
2 changes: 1 addition & 1 deletion tests/unit.ts → tests/unit/interface.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import test from 'ava';
import {getFileExtension} from '../src/util/util';
import {getFileExtension} from '../../src/util/util';

test('[internal] test util/getFileExtension', t => {
t.is(getFileExtension('test.wast'), 'wast');
Expand Down
35 changes: 17 additions & 18 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
{
"compilerOptions": {
"module": "commonjs",
"moduleResolution": "node",
"target": "ES2020",
"outDir": "out",
"lib": [
"ES2020"
],
"rootDir": ".",
"sourceMap": true,
"strict": true,
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true
},
"exclude": [
"example",
"WABT"
]
"compilerOptions": {
"module": "commonjs",
"moduleResolution": "node",
"target": "ES2020",
"outDir": "out",
"lib": [
"ES2020"
],
"rootDir": ".",
"sourceMap": true,
"strict": true,
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true
},
"exclude": [
"WABT"
]
}

0 comments on commit cfa5b3c

Please sign in to comment.