Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hideya committed Jan 7, 2025
1 parent 8a82837 commit 0b88e6d
Show file tree
Hide file tree
Showing 10 changed files with 4,592 additions and 846 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- run: npm ci
- run: npm run lint
- run: npm test
- run: npm run build
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

node_modules/
dist/
coverage/
.DS_Store
3 changes: 3 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/node_modules
/src
/tests
/coverage
tsconfig.json
eslint.config.js
jest.config.js
8 changes: 8 additions & 0 deletions .replit
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
modules = ["nodejs-20"]
run = "npm run watch"

[nix]
channel = "stable-24_05"

[deployment]
run = ["sh", "-c", "npm run watch"]
21 changes: 21 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
export default {
// use ts-jest/presets/default-esm to handle ECMAScript Modules
preset: "ts-jest/presets/default-esm",
testEnvironment: "node",
extensionsToTreatAsEsm: [".ts"],
moduleNameMapper: {
"^(\\.{1,2}/.*)\\.js$": "$1",
},
transform: {
"^.+\\.tsx?$": [
"ts-jest",
{
useESM: true,
tsconfig: "tsconfig.json",
},
],
},
transformIgnorePatterns: [],
testMatch: ["**/tests/**/*.test.ts"],
resolver: 'jest-ts-webcompat-resolver',
};
Loading

0 comments on commit 0b88e6d

Please sign in to comment.