From c645a3fb141b27fb1135f77634ce47d6131c2f9b Mon Sep 17 00:00:00 2001 From: Alexander Cerutti Date: Tue, 4 Apr 2023 21:05:25 +0200 Subject: [PATCH] Added settings for jest --- .vscode/settings.json | 4 +++- jest.config.cjs | 11 +++++++++++ package.json | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 jest.config.cjs diff --git a/.vscode/settings.json b/.vscode/settings.json index 2e8a291..fd15c98 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,5 +3,7 @@ "editor.formatOnSave": true, "editor.insertSpaces": false, "editor.smoothScrolling": true, - "editor.defaultFormatter": "esbenp.prettier-vscode" + "editor.defaultFormatter": "esbenp.prettier-vscode", + + "jest.jestCommandLine": "node --no-warnings ./node_modules/.bin/jest -c jest.config.cjs --runInBand --silent" } diff --git a/jest.config.cjs b/jest.config.cjs new file mode 100644 index 0000000..957d790 --- /dev/null +++ b/jest.config.cjs @@ -0,0 +1,11 @@ +// @ts-check + +/** + * @type {import("jest").Config} + */ + +module.exports = { + moduleFileExtensions: ["js", "mjs", "cjs"], + testEnvironment: "node", + testMatch: ["**/specs/**/*.spec.cjs"], +}; diff --git a/package.json b/package.json index b3749cd..8e66226 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "build:src": "rimraf lib && npx tsc -p tsconfig.dist.json", "build:spec": "rimraf \"./spec/*.!(ts)\" && npx tsc -p tsconfig.spec.json", "prepublishOnly": "npm run build", - "test": "NODE_OPTIONS=\"--experimental-vm-modules --no-warnings\" jest -c jest.config.mjs --silent" + "test": "NODE_OPTIONS=\"--experimental-vm-modules --no-warnings\" jest -c jest.config.cjs --silent" }, "author": "Alexander Patrick Cerutti", "license": "MIT",