Skip to content

Commit

Permalink
feat: [SCRUM-41] update jest command
Browse files Browse the repository at this point in the history
  • Loading branch information
gavanlamb committed Jun 13, 2024
1 parent bc1effc commit c24dca1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ jobs:
if: always()
with:
skip-step: all
coverage-file: ./coverage/coverage-summary.json
base-coverage-file: ./coverage/coverage-summary.json
coverage-file: ./test-results/summary.json
base-coverage-file: ./test-results/summary.json
prnumber: ${{ github.event.pull_request.number }}

- name: Package
Expand Down
9 changes: 5 additions & 4 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import { basename, extname } from 'node:path';
import type { Config } from '@jest/types';

export default {
preset: 'ts-jest',
const config: Config.InitialOptions = {
verbose: true,
rootDir: './',
testEnvironment: 'node',
moduleFileExtensions: ['js', 'ts'],
testMatch: ['**/*.test.ts'],
testPathIgnorePatterns: ['/node_modules/', '/dist/'],
transform: {
'^.+\\.ts$': 'ts-jest'
},
coverageReporters: ['json-summary', 'text', 'lcov'],
collectCoverage: true,
collectCoverageFrom: ['./src/**'],
reporters: [
'default',
Expand All @@ -27,3 +26,5 @@ export default {
}]
]
};

export default config;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"scripts": {
"lint": "npx eslint . -c .eslintrc.yml",
"package": "npx ncc build src/index.ts -o dist --source-map --license licenses.txt",
"test": "npx jest",
"test": "npx jest --json --outputFile=./test-results/summary.json",
"all": "npm run lint && npm run test && npm run package"
},
"license": "MIT",
Expand Down

0 comments on commit c24dca1

Please sign in to comment.