Skip to content

Commit

Permalink
test: add jest
Browse files Browse the repository at this point in the history
  • Loading branch information
zhensherlock committed Jun 21, 2024
1 parent ef42a9f commit b2c5869
Show file tree
Hide file tree
Showing 6 changed files with 20,130 additions and 13,282 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: build

on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install Node
uses: actions/setup-node@v4
with:
node-version: 16
cache: npm

- name: Install Package
run: npm ci

- name: Build Package
run: npm run build

- name: Test Package
run: npm run test

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
verbose: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
5 changes: 3 additions & 2 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ const presets = [
'maintained node versions',
'not dead',
'safari >= 7'
],
},
]
}
],
'@babel/preset-typescript'
]

const plugins = [
Expand Down
8 changes: 8 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
collectCoverage: true,
coverageDirectory: 'coverage',
coverageReporters: ['json', 'lcov', 'text', 'clover']
}
Loading

0 comments on commit b2c5869

Please sign in to comment.