diff --git a/packages/tests/.eslintrc.cjs b/packages/tests/.eslintrc.cjs index cb52e850cc..8de4a3fd8d 100644 --- a/packages/tests/.eslintrc.cjs +++ b/packages/tests/.eslintrc.cjs @@ -1,7 +1,7 @@ module.exports = { parserOptions: { tsconfigRootDir: __dirname, - project: "./tsconfig.json", + project: "./tsconfig.dev.json", }, rules: { "@typescript-eslint/no-non-null-assertion": "off", diff --git a/packages/tests/.mocharc.json b/packages/tests/.mocharc.json index 0658ab762d..b4cde4e22d 100644 --- a/packages/tests/.mocharc.json +++ b/packages/tests/.mocharc.json @@ -1,6 +1,6 @@ { "extension": ["ts"], - "spec": "tests/**/*.spec.ts", + "spec": "tests/*.spec.ts", "require": ["ts-node/register", "isomorphic-fetch", "jsdom-global/register"], "loader": "ts-node/esm", "node-option": [ diff --git a/packages/tests/karma.conf.cjs b/packages/tests/karma.conf.cjs index febf1611b4..daa7293fc1 100644 --- a/packages/tests/karma.conf.cjs +++ b/packages/tests/karma.conf.cjs @@ -4,9 +4,9 @@ const webpack = require("webpack"); module.exports = function (config) { config.set({ frameworks: ["webpack", "mocha"], - files: ["src/lib/**/!(node).spec.ts"], + files: ["tests/**/!(node).spec.ts"], preprocessors: { - "src/lib/**/!(node).spec.ts": ["webpack"], + "tests/**/!(node).spec.ts": ["webpack"], }, envPreprocessor: ["CI"], reporters: ["progress"], diff --git a/packages/tests/package.json b/packages/tests/package.json index a340235a64..ee663da492 100644 --- a/packages/tests/package.json +++ b/packages/tests/package.json @@ -41,6 +41,7 @@ "privacy" ], "scripts": { + "build": "tsc", "fix": "run-s fix:*", "fix:prettier": "prettier . --write", "fix:lint": "eslint src tests --ext .ts --ext .cjs --fix", @@ -50,8 +51,8 @@ "nwaku:build": "(PROC=$(nproc --all 2>/dev/null || echo 2); cd ../../nwaku; make -j$PROC update; NIMFLAGS=\"-d:chronicles_colors=off -d:chronicles_sinks=textlines -d:chronicles_log_level=TRACE\" make -j$PROC wakunode2)", "nwaku:force-build": "(cd ../../nwaku && rm -rf ./build/ ./vendor) && run-s nwaku:build", "check": "run-s check:*", - "check:lint": "eslint src tests --ext .ts", "check:prettier": "prettier . --list-different", + "check:lint": "eslint src tests --ext .ts", "check:spelling": "cspell \"{README.md,{tests,src}/**/*.ts}\"", "check:tsc": "tsc -p tsconfig.json", "test": "run-s test:*", diff --git a/packages/tests/tsconfig.dev.json b/packages/tests/tsconfig.dev.json new file mode 100644 index 0000000000..d64199f6ad --- /dev/null +++ b/packages/tests/tsconfig.dev.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "module": "esnext", + "noEmit": true + }, + "include": ["src", "tests"] +} diff --git a/packages/tests/tsconfig.json b/packages/tests/tsconfig.json index 165ba89ee0..49df3977af 100644 --- a/packages/tests/tsconfig.json +++ b/packages/tests/tsconfig.json @@ -2,9 +2,9 @@ "compilerOptions": { "incremental": true, "target": "es2020", - "noEmit": true, + "outDir": "dist/", "moduleResolution": "node", - "module": "esnext", + "module": "es2020", "declaration": true, "sourceMap": true, "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */, @@ -44,7 +44,8 @@ "types": ["node", "mocha"], "typeRoots": ["node_modules/@types", "src/types"] }, - "include": ["tests", "src"], + "include": ["src"], + "exclude": [], "compileOnSave": false, "ts-node": { "files": true diff --git a/packages/tests/tsconfig.karma.json b/packages/tests/tsconfig.karma.json index c945ddb239..c540c783ff 100644 --- a/packages/tests/tsconfig.karma.json +++ b/packages/tests/tsconfig.karma.json @@ -1,5 +1,5 @@ { - "extends": "./tsconfig", + "extends": "./tsconfig.dev", "compilerOptions": { "noEmit": false }