Jest GitHub Action annotation (#194)
Jest now supports a reporter which emits GitHub Actions annotations. So if a test fails, it should annotate your PR when you view it on GitHub. See their example at https://jestjs.io/docs/configuration#github-actions-reporter Also, use typescript for the config file.
This commit is contained in:
2
.github/workflows/format.yml
vendored
2
.github/workflows/format.yml
vendored
@ -13,4 +13,4 @@ jobs:
|
||||
with:
|
||||
node-version: '16.x'
|
||||
- run: yarn install
|
||||
- run: yarn prettier --check src
|
||||
- run: yarn prettier --check src jest.config.ts
|
||||
|
||||
@ -1,15 +0,0 @@
|
||||
module.exports = {
|
||||
testEnvironment: 'jsdom',
|
||||
preset: 'ts-jest/presets/js-with-ts',
|
||||
transform: {
|
||||
'^.+\\.(ts|tsx)?$': 'ts-jest',
|
||||
"^.+\\.(js|jsx)$": "babel-jest",
|
||||
},
|
||||
transformIgnorePatterns: [
|
||||
"//node_modules/(?!(allotment|@tauri-apps/api)/)",
|
||||
],
|
||||
moduleNameMapper: {
|
||||
'^allotment$': 'allotment/dist/legacy',
|
||||
},
|
||||
setupFilesAfterEnv: ['./src/setupTests.ts'],
|
||||
}
|
||||
18
jest.config.ts
Normal file
18
jest.config.ts
Normal file
@ -0,0 +1,18 @@
|
||||
import type { Config } from 'jest'
|
||||
|
||||
const config: Config = {
|
||||
testEnvironment: 'jsdom',
|
||||
preset: 'ts-jest/presets/js-with-ts',
|
||||
transform: {
|
||||
'^.+\\.(ts|tsx)?$': 'ts-jest',
|
||||
'^.+\\.(js|jsx)$': 'babel-jest',
|
||||
},
|
||||
transformIgnorePatterns: ['//node_modules/(?!(allotment|@tauri-apps/api)/)'],
|
||||
moduleNameMapper: {
|
||||
'^allotment$': 'allotment/dist/legacy',
|
||||
},
|
||||
setupFilesAfterEnv: ['./src/setupTests.ts'],
|
||||
reporters: [['github-actions', { silent: false }], 'summary'],
|
||||
}
|
||||
|
||||
export default config
|
||||
Reference in New Issue
Block a user