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" } }