Skip to content

Commit

Permalink
chore: ci jest
Browse files Browse the repository at this point in the history
  • Loading branch information
lvisei committed Nov 13, 2024
1 parent 8718e9d commit 4fe9cca
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .fatherrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ export default defineConfig({
filename: 'index.min.js',
},
platform: 'browser',
targets: {
chrome: 51,
},
externals: {
lodash: '_',
'lodash-es': '_',
Expand Down
10 changes: 2 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,13 @@ jobs:
uses: ./.github/actions/prepare-install
with:
node-version: ${{ matrix.node-version }}

- name: Check
run: |
pnpm check-deps
pnpm check-format
- name: Lint
run: pnpm lint:ts

# todo test
# unit-test:
# runs-on: ubuntu-latest
# strategy:
Expand All @@ -53,10 +50,8 @@ jobs:
# uses: ./.github/actions/prepare-install
# with:
# node-version: ${{ matrix.node-version }}

# - name: Coverage Test
# run: pnpm unit

# - name: Unit Test
# run: pnpm test:unit

size-test:
runs-on: ubuntu-latest
Expand All @@ -69,6 +64,5 @@ jobs:
uses: ./.github/actions/prepare-install
with:
node-version: ${{ matrix.node-version }}

- name: Szie Test With Build
run: pnpm test:size
7 changes: 7 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
import type { Config } from 'jest';

const esm = ['internmap', 'd3-*'].join('|');

const config: Config = {
preset: 'ts-jest',
testEnvironment: 'jsdom',
collectCoverage: false,
testRegex: '(/__tests__/.*\\.(test|spec))\\.ts$',
collectCoverageFrom: ['src/**/*.ts'],
// Transform esm to cjs.
transformIgnorePatterns: [
`<rootDir>/node_modules/(?!(${esm}))`,
`<rootDir>/node_modules/.pnpm/(?!(${esm}))`,
],
};

export default config;
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
"prettier-plugin-organize-imports": "^4.1.0",
"react": "^18.0.0",
"ts-jest": "^29.2.5",
"ts-node": "^10.9.2",
"typescript": "^5.6.3",
"typescript-eslint": "^8.13.0",
"webpack-bundle-analyzer": "^4.10.2"
Expand Down

0 comments on commit 4fe9cca

Please sign in to comment.