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.
19 lines
509 B
TypeScript
19 lines
509 B
TypeScript
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
|