Remove commented configuration, add typeahead plugin for jest

This commit is contained in:
Jeff 2024-06-04 21:01:48 -04:00
parent 8400f130eb
commit fc3165e155
4 changed files with 116 additions and 59 deletions

View File

@ -1,22 +1,3 @@
// import type {Config} from 'jest';
// const config: Config = {
// verbose: true,
// // testPathIgnorePatterns: [ "data/"],
// watchPathIgnorePatterns: [
// "data"
// ],
// preset: 'ts-jest',
// testEnvironment: 'jest-environment-jsdom',
// transform: {
// "^.+\\.tsx?$": "ts-jest"
// // process `*.tsx` files with `ts-jest`
// },
// resetMocks: true,
// };
// export default config;
const ignorePatterns = [
"\\/build\\/",
"\\/coverage\\/",
@ -38,9 +19,8 @@ module.exports = {
},
watchPathIgnorePatterns: [...ignorePatterns, "\\/node_modules\\/"],
watchPlugins: [
// require.resolve("jest-watch-select-projects"),
// require.resolve("jest-watch-typeahead/filename"),
// require.resolve("jest-watch-typeahead/testname"),
require.resolve("jest-watch-typeahead/filename"),
require.resolve("jest-watch-typeahead/testname"),
],
displayName: "testing",
setupFiles: [],

110
package-lock.json generated
View File

@ -48,6 +48,7 @@
"eslint-plugin-react-hooks": "^4.6.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jest-watch-typeahead": "^2.2.2",
"sinon": "^17.0.1",
"sinon-chai": "^3.7.0",
"supertest": "^7.0.0",
@ -10716,6 +10717,115 @@
"integrity": "sha512-wRiUsea88TjKDc4FBEn+sLvIDesp6brMbGWnJGjew2waAc9evdhja/2LvePc898HJbHw0L+MTWy7NhpnELAvLQ==",
"dev": true
},
"node_modules/jest-watch-typeahead": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/jest-watch-typeahead/-/jest-watch-typeahead-2.2.2.tgz",
"integrity": "sha512-+QgOFW4o5Xlgd6jGS5X37i08tuuXNW8X0CV9WNFi+3n8ExCIP+E1melYhvYLjv5fE6D0yyzk74vsSO8I6GqtvQ==",
"dev": true,
"dependencies": {
"ansi-escapes": "^6.0.0",
"chalk": "^5.2.0",
"jest-regex-util": "^29.0.0",
"jest-watcher": "^29.0.0",
"slash": "^5.0.0",
"string-length": "^5.0.1",
"strip-ansi": "^7.0.1"
},
"engines": {
"node": "^14.17.0 || ^16.10.0 || >=18.0.0"
},
"peerDependencies": {
"jest": "^27.0.0 || ^28.0.0 || ^29.0.0"
}
},
"node_modules/jest-watch-typeahead/node_modules/ansi-escapes": {
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-6.2.1.tgz",
"integrity": "sha512-4nJ3yixlEthEJ9Rk4vPcdBRkZvQZlYyu8j4/Mqz5sgIkddmEnH2Yj2ZrnP9S3tQOvSNRUIgVNF/1yPpRAGNRig==",
"dev": true,
"engines": {
"node": ">=14.16"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/jest-watch-typeahead/node_modules/ansi-regex": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz",
"integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==",
"dev": true,
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/chalk/ansi-regex?sponsor=1"
}
},
"node_modules/jest-watch-typeahead/node_modules/chalk": {
"version": "5.3.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz",
"integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==",
"dev": true,
"engines": {
"node": "^12.17.0 || ^14.13 || >=16.0.0"
},
"funding": {
"url": "https://github.com/chalk/chalk?sponsor=1"
}
},
"node_modules/jest-watch-typeahead/node_modules/char-regex": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/char-regex/-/char-regex-2.0.1.tgz",
"integrity": "sha512-oSvEeo6ZUD7NepqAat3RqoucZ5SeqLJgOvVIwkafu6IP3V0pO38s/ypdVUmDDK6qIIHNlYHJAKX9E7R7HoKElw==",
"dev": true,
"engines": {
"node": ">=12.20"
}
},
"node_modules/jest-watch-typeahead/node_modules/slash": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/slash/-/slash-5.1.0.tgz",
"integrity": "sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==",
"dev": true,
"engines": {
"node": ">=14.16"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/jest-watch-typeahead/node_modules/string-length": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/string-length/-/string-length-5.0.1.tgz",
"integrity": "sha512-9Ep08KAMUn0OadnVaBuRdE2l615CQ508kr0XMadjClfYpdCyvrbFp6Taebo8yyxokQ4viUd/xPPUA4FGgUa0ow==",
"dev": true,
"dependencies": {
"char-regex": "^2.0.0",
"strip-ansi": "^7.0.1"
},
"engines": {
"node": ">=12.20"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/jest-watch-typeahead/node_modules/strip-ansi": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz",
"integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==",
"dev": true,
"dependencies": {
"ansi-regex": "^6.0.1"
},
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/chalk/strip-ansi?sponsor=1"
}
},
"node_modules/jest-watcher": {
"version": "29.7.0",
"resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.7.0.tgz",

View File

@ -24,12 +24,11 @@
},
"devDependencies": {
"@babel/core": "^7.24.5",
"@babel/plugin-proposal-export-namespace-from": "^7.18.9",
"@babel/plugin-proposal-optional-chaining": "^7.21.0",
"@babel/preset-env": "^7.24.5",
"@babel/preset-react": "^7.24.1",
"@babel/preset-typescript": "^7.24.1",
"@babel/plugin-proposal-export-namespace-from": "^7.18.9",
"@babel/plugin-proposal-optional-chaining": "^7.21.0",
"babel-plugin-transform-remove-console": "^6.9.4",
"@remix-run/dev": "^2.9.0",
"@remix-run/testing": "^2.9.1",
"@swc/core": "^1.5.7",
@ -44,6 +43,7 @@
"@typescript-eslint/eslint-plugin": "^6.7.4",
"@typescript-eslint/parser": "^6.7.4",
"babel-jest": "^29.7.0",
"babel-plugin-transform-remove-console": "^6.9.4",
"chai": "^4.4.1",
"chai-as-promised": "^7.1.1",
"eslint": "^8.38.0",
@ -54,6 +54,7 @@
"eslint-plugin-react-hooks": "^4.6.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jest-watch-typeahead": "^2.2.2",
"sinon": "^17.0.1",
"sinon-chai": "^3.7.0",
"supertest": "^7.0.0",

View File

@ -1,37 +1,3 @@
// {
// "include": [
// "**/*.ts",
// "**/*.tsx",
// "**/.server/**/*.ts",
// "**/.server/**/*.tsx",
// "**/.client/**/*.ts",
// "**/.client/**/*.tsx"
// ],
// "exclude": ["node_modules"],
// "compilerOptions": {
// "lib": ["DOM", "DOM.Iterable", "ES2022"],
// "types": ["@remix-run/jsdom", "@remix-run/node", "@remix-run/test", "vite/client", "jest", "node"],
// "isolatedModules": true,
// "esModuleInterop": true,
// "jsx": "react-jsx",
// "moduleResolution": "Bundler",
// "resolveJsonModule": true,
// "target": "ES2022",
// "module": "ES2022",
// "strict": true,
// "allowJs": true,
// "skipLibCheck": true,
// "forceConsistentCasingInFileNames": true,
// "baseUrl": ".",
// "paths": {
// "~/*": ["./app/*"]
// },
// // Vite takes care of building everything, not tsc.
// "noEmit": true
// }
// }
{
"include": ["**/*.ts", "**/*.tsx"],
"exclude": ["dist", "__tests__", "node_modules"],