mirror of
https://git.netzspielplatz.de/docker-multiarch/openwrt-firmware-selector.git
synced 2025-11-08 21:59:27 +00:00
Add JS tests. Cleanup code and add github workflow to test.
This commit is contained in:
parent
f3133a38a0
commit
3f8de60160
20 changed files with 533 additions and 264 deletions
30
jest.config.js
Normal file
30
jest.config.js
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
module.exports = {
|
||||
// The root of your source code, typically /src
|
||||
// `<rootDir>` is a token Jest substitutes
|
||||
roots: ['<rootDir>/src'],
|
||||
|
||||
// Jest transformations -- this adds support for TypeScript
|
||||
// using ts-jest
|
||||
transform: {
|
||||
'^.+\\.tsx?$': 'ts-jest',
|
||||
},
|
||||
|
||||
// Runs special logic, such as cleaning up components
|
||||
// when using React Testing Library and adds special
|
||||
// extended assertions to Jest
|
||||
setupFilesAfterEnv: ['@testing-library/jest-dom/extend-expect'],
|
||||
|
||||
// Test spec file resolution pattern
|
||||
// Matches parent folder `__tests__` and filename
|
||||
// should contain `test` or `spec`.
|
||||
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$',
|
||||
|
||||
// Module file extensions for importing
|
||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
|
||||
|
||||
moduleNameMapper: {
|
||||
'^.+\\.(css|scss)$': 'identity-obj-proxy',
|
||||
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
|
||||
'<rootDir>/fileMocks.js',
|
||||
},
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue