Skip to content

Commit

Permalink
test: add unit tests (#34)
Browse files Browse the repository at this point in the history
Resolves #24

## Changes

Add unit tests and run them in the GitHub actions.
  • Loading branch information
mheob committed Jun 1, 2023
1 parent 3f11618 commit 4ea446e
Show file tree
Hide file tree
Showing 8 changed files with 899 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/check.yml
Expand Up @@ -31,3 +31,6 @@ jobs:

- name: Lint files
run: pnpm run lint

- name: Test files
run: pnpm run test
3 changes: 3 additions & 0 deletions .gitignore
@@ -1,6 +1,9 @@
# build
dist

# test
coverage

# dependencies
node_modules
.pnpm-debug.log*
9 changes: 7 additions & 2 deletions package.json
Expand Up @@ -29,12 +29,15 @@
"./dist/"
],
"scripts": {
"benchmark": "node ./utils/perf.cjs",
"build": "rimraf ./dist/* && concurrently \"pnpm build:cjs\" \"pnpm build:esm\"",
"build:cjs": "tsc -b ./tsconfig.cjs.json",
"build:esm": "tsc -b ./tsconfig.esm.json",
"format": "prettier --write \"**/*.{cjs,js,mjs,ts,json,md,mdx,yml}\"",
"lint": "eslint . --ext .cjs,.js,.mjs,.ts --fix --ignore-path .gitignore",
"prepare": "ts-node ./scripts/prepare.ts && husky install"
"prepare": "ts-node ./scripts/prepare.ts && husky install",
"test": "vitest",
"test:coverage": "vitest run --coverage"
},
"lint-staged": {
"*.{cjs,js,mjs,ts}": "eslint --fix",
Expand All @@ -54,6 +57,7 @@
"@mheob/prettier-config": "^3.0.1",
"@mheob/tsconfig": "^2.0.0",
"@types/node": "^18.16.16",
"@vitest/coverage-c8": "^0.31.2",
"commitizen": "^4.3.0",
"concurrently": "^8.0.1",
"cz-git": "^1.6.1",
Expand All @@ -63,7 +67,8 @@
"prettier": "^2.8.8",
"rimraf": "^5.0.1",
"ts-node": "^10.9.1",
"typescript": "^5.0.4"
"typescript": "^5.0.4",
"vitest": "^0.31.2"
},
"publishConfig": {
"access": "public"
Expand Down

0 comments on commit 4ea446e

Please sign in to comment.