Skip to content

Commit 2acdd5a

Browse files
committed
chore(tooling): set up unit tests
1 parent 0c8f385 commit 2acdd5a

File tree

5 files changed

+2572
-38
lines changed

5 files changed

+2572
-38
lines changed

.npmignore

Whitespace-only changes.

jest.config.cjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
preset: 'ts-jest',
3+
testEnvironment: 'jsdom',
4+
};

package.json

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,27 @@
11
{
22
"scripts": {
33
"build": "node_modules/.bin/esbuild --target=es2019 ./src/index.jsx --bundle --platform=node --outfile=index.js",
4-
"prepare": "husky install"
4+
"prepare": "husky install",
5+
"test:jest": "jest",
6+
"test:watch": "jest --watch",
7+
"test:coverage": "jest --coverage",
8+
"test": "npm run test:jest --"
59
},
610
"dependencies": {
711
"@actions/core": "^1.4.0",
812
"@actions/exec": "^1.1.0",
913
"d3": "^7.0.0",
1014
"esbuild": "^0.12.15",
11-
"husky": "^7.0.1",
1215
"lodash": "^4.17.21",
1316
"minimatch": "^3.0.4",
1417
"react": "^17.0.2",
1518
"react-dom": "^17.0.2"
1619
},
1720
"devDependencies": {
18-
"husky": "^7.0.0"
21+
"husky": "^7.0.0",
22+
"@types/jest": "^27.0.1",
23+
"jest": "^27.0.6",
24+
"ts-jest": "^27.0.4",
25+
"typescript": "^4.3.5"
1926
}
2027
}

tsconfig.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es5",
4+
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd',
5+
6+
/* Strict Type-Checking Options */
7+
"strict": true, /* Enable all strict type-checking options. */
8+
"noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
9+
"strictNullChecks": true, /* Enable strict null checks. */
10+
"rootDirs": [
11+
"src"
12+
],
13+
"allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export.
14+
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES
15+
/* Advanced Options */
16+
"skipLibCheck": true, /* Skip type checking of declaration files. */
17+
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
18+
}
19+
}

0 commit comments

Comments
 (0)