From 62df86acb4e10b91f09b774c44a0cee0497b24cf Mon Sep 17 00:00:00 2001 From: Tangent Wantwight Date: Sun, 6 Aug 2023 02:38:22 -0400 Subject: [PATCH] Init Jest --- jest.config.js | 5 +++++ package.json | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 jest.config.js diff --git a/jest.config.js b/jest.config.js new file mode 100644 index 0000000..935d389 --- /dev/null +++ b/jest.config.js @@ -0,0 +1,5 @@ +/** @type {import('ts-jest').JestConfigWithTsJest} */ +export default { + preset: "ts-jest/presets/default-esm", + testEnvironment: "node", +}; diff --git a/package.json b/package.json index 3ad8db2..ccea34e 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,16 @@ { + "type": "module", "scripts": { "check": "tsc --noEmit", "serve": "esbuild src/3x5.ts --bundle --format=iife --outfile=bundle.js --sourcemap --servedir=.", - "build": "esbuild src/3x5.ts --bundle --format=iife --outfile=bundle.js" + "build": "esbuild src/3x5.ts --bundle --format=iife --outfile=bundle.js", + "test": "node --experimental-vm-modules ./node_modules/.bin/jest" }, "devDependencies": { + "@types/jest": "^29.5.3", "esbuild": "^0.18.17", "jest": "^29.6.2", + "ts-jest": "^29.1.1", "typescript": "^5.1.6" } }