Skip to content

Commit

Permalink
Add basic tests (#70)
Browse files Browse the repository at this point in the history
* integrate jest & write simple ts test file

* add test to workflow
  • Loading branch information
seanmakesgames authored Dec 7, 2023
1 parent bc10a03 commit d40040a
Show file tree
Hide file tree
Showing 6 changed files with 1,266 additions and 68 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ jobs:
- name: Run prettier
run: pnpm lint

build:
name: Build check
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -49,7 +49,9 @@ jobs:
cache: pnpm
- name: Install dependencies
run: pnpm install
- name: Run test build
- name: Run test
run: pnpm test
- name: Run build
run: pnpm build

dependency-review:
Expand Down
5 changes: 5 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: "ts-jest",
testEnvironment: "node",
};
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"scripts": {
"start": "docusaurus start",
"build": "docusaurus build",
"test": "jest",
"swizzle": "docusaurus swizzle",
"clear": "docusaurus clear",
"serve": "docusaurus serve",
Expand All @@ -29,9 +30,12 @@
"@docusaurus/theme-common": "^3.0.1",
"@docusaurus/tsconfig": "^3.0.1",
"@docusaurus/types": "^3.0.1",
"@jest/globals": "^29.7.0",
"@types/node": "^20.8.10",
"@types/react": "^18.2.36",
"jest": "^29.7.0",
"prettier": "^3.0.3",
"ts-jest": "^29.1.1",
"typescript": "5.2.2"
},
"engines": {
Expand Down
Loading

0 comments on commit d40040a

Please sign in to comment.