Makes control.js testable with various config. changes. Adds coverage for util.js, roles.js, starts on control.js. Updates the entrypoint; untested so far

This commit is contained in:
Ben Menesini
2024-05-19 19:36:02 -07:00
parent e14c6f1685
commit db7338bcf3
11 changed files with 1483 additions and 767 deletions

19
jest.config.js Normal file
View File

@@ -0,0 +1,19 @@
module.exports = {
verbose: true,
moduleFileExtensions: ['js', 'jsx', 'json', 'node'],
moduleNameMapper: {
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/__mocks__/fileMock.js',
'\\.(css|less)$': 'identity-obj-proxy',
"^preact(/(.*)|$)": "preact$1"
},
testEnvironment: 'node',
transform: {
'^.+\\.jsx?$': 'babel-jest',
},
testPathIgnorePatterns: ['/node_modules/'],
coveragePathIgnorePatterns: ['/node_modules/'],
collectCoverage: true,
coverageReporters: ['json', 'lcov', 'text', 'clover'],
testEnvironment: 'jsdom'
};