From 66f715cf2a333badf85d875c497dae55a95da486 Mon Sep 17 00:00:00 2001 From: Tom Lauwaerts Date: Sat, 7 Dec 2024 00:41:51 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=91=20Hotfix=20test:prebuild=20(#29)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 ++ package.json | 3 ++- tsconfig.build.json | 3 ++- tsconfig.tests.json | 15 +++++++++++++++ 4 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 tsconfig.tests.json diff --git a/.gitignore b/.gitignore index c48ba94..bca33a7 100644 --- a/.gitignore +++ b/.gitignore @@ -39,6 +39,8 @@ lib/*.js test/*.js *.map +*.tsbuildinfo + # Project specific WABT core/ diff --git a/package.json b/package.json index a9e6cac..664186b 100644 --- a/package.json +++ b/package.json @@ -17,9 +17,10 @@ "clean": "rm -rf dist", "build": "npm run build:cjs", "build:cjs": "tsc --project tsconfig.build.json", + "build:tests": "tsc --outDir out --project tsconfig.tests.json", "watch": "tsc -watch -p ./", "lint": "eslint src/**/* --config .eslint.config.mjs", - "test:prebuild": "npm run build && npx tsc tests/unit/* --outDir out --sourceMap", + "test:prebuild": "npm run build && npm run build:tests", "test:all": "npm run test:prebuild && npm run test:ava", "test:ava": "ava", "coverage:test:ava": "c8 --src src/ --all ava" diff --git a/tsconfig.build.json b/tsconfig.build.json index b63bdad..b17a3ba 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -9,6 +9,7 @@ "noEmit": false, "declaration": true, "declarationDir": "dist/types", - "incremental": true + "incremental": true, + "resolveJsonModule": true } } diff --git a/tsconfig.tests.json b/tsconfig.tests.json new file mode 100644 index 0000000..0a30929 --- /dev/null +++ b/tsconfig.tests.json @@ -0,0 +1,15 @@ +{ + "extends": "./tsconfig.build.json", + "include": [ + "tests/unit/**/*.ts" + ], + "compilerOptions": { + "rootDir": ".", + "sourceMap": true, + "noEmit": false, + "declaration": true, + "declarationDir": "dist/types", + "incremental": true, + "resolveJsonModule": true + } +}