Open laszlocph opened 5 years ago
I'm also getting the same error -
I was able to fix this by doing the following changes. I've also fixed the lint issue. The default lint script doesn't work. -
jest.config.js
module.exports = {
preset: "jest-preset-preact",
setupFiles: [
"<rootDir>/src/tests/__mocks__/setupTests.js",
"<rootDir>/src/tests/__mocks__/browserMocks.js",
"<rootDir>/src/tests/__mocks__/fileMocks.js"
],
testURL: "http://localhost:8080",
moduleNameMapper: {
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$":
"<rootDir>/src/tests/__mocks__/fileMocks.js"
},
testPathIgnorePatterns: ["<rootDir>/node_modules/"],
testMatch: ["<rootDir>/src/tests/**/*.test.{js,jsx,ts,tsx}"],
transform: {
"^.+\\.(js|jsx|ts|tsx)$": "<rootDir>/node_modules/babel-jest"
}
};
package.json
"scripts": {
"lint": "eslint ./src --ext .js --ext .ts --ext .jsx --ext .tsx",
"test": "jest"
},
Has this not been fixed with #31 ?
https://github.com/preactjs/preact-cli/issues/892