mirror of
https://github.com/ets-cfuhrman-pfe/EvalueTonSavoir.git
synced 2025-08-11 21:23:54 -04:00
Get tests to run without TS1343 error (npm test)
This commit is contained in:
parent
d72dd3ba03
commit
d01983a514
7 changed files with 19 additions and 6 deletions
|
|
@ -3,7 +3,7 @@
|
|||
module.exports = {
|
||||
roots: ['<rootDir>/src'],
|
||||
transform: {
|
||||
'^.+\\.(ts|tsx)$': 'ts-jest',
|
||||
'^.+\\.(ts|tsx)$': ['ts-jest', { tsconfig: 'tsconfig.json' }],
|
||||
'^.+\\.(js|jsx)$': 'babel-jest'
|
||||
},
|
||||
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$',
|
||||
|
|
@ -13,5 +13,5 @@ module.exports = {
|
|||
moduleNameMapper: {
|
||||
'\\.(css|less|scss|sass)$': 'identity-obj-proxy'
|
||||
},
|
||||
transformIgnorePatterns: ['node_modules/(?!nanoid/)']
|
||||
transformIgnorePatterns: ['node_modules/(?!nanoid/)'],
|
||||
};
|
||||
|
|
|
|||
10
client/package-lock.json
generated
10
client/package-lock.json
generated
|
|
@ -58,6 +58,7 @@
|
|||
"ts-jest": "^29.1.1",
|
||||
"typescript": "^5.0.2",
|
||||
"vite": "^4.4.5",
|
||||
"vite-plugin-environment": "^1.1.3",
|
||||
"vite-plugin-rewrite-all": "^1.0.1"
|
||||
}
|
||||
},
|
||||
|
|
@ -12459,6 +12460,15 @@
|
|||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/vite-plugin-environment": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/vite-plugin-environment/-/vite-plugin-environment-1.1.3.tgz",
|
||||
"integrity": "sha512-9LBhB0lx+2lXVBEWxFZC+WO7PKEyE/ykJ7EPWCq95NEcCpblxamTbs5Dm3DLBGzwODpJMEnzQywJU8fw6XGGGA==",
|
||||
"dev": true,
|
||||
"peerDependencies": {
|
||||
"vite": ">= 2.7"
|
||||
}
|
||||
},
|
||||
"node_modules/vite-plugin-rewrite-all": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/vite-plugin-rewrite-all/-/vite-plugin-rewrite-all-1.0.2.tgz",
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
"build": "tsc && vite build",
|
||||
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
||||
"preview": "vite preview",
|
||||
"test": "jest",
|
||||
"test": "jest --colors",
|
||||
"test:watch": "jest --watch"
|
||||
},
|
||||
"dependencies": {
|
||||
|
|
@ -62,6 +62,7 @@
|
|||
"ts-jest": "^29.1.1",
|
||||
"typescript": "^5.0.2",
|
||||
"vite": "^4.4.5",
|
||||
"vite-plugin-environment": "^1.1.3",
|
||||
"vite-plugin-rewrite-all": "^1.0.1"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// constants.tsx
|
||||
const ENV_VARIABLES = {
|
||||
MODE: 'production',
|
||||
VITE_BACKEND_URL: import.meta.env.VITE_BACKEND_URL || ""
|
||||
VITE_BACKEND_URL: process.env.VITE_BACKEND_URL || ""
|
||||
};
|
||||
|
||||
export { ENV_VARIABLES };
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
"target": "ESNext",
|
||||
"useDefineForClassFields": true,
|
||||
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
||||
"module": "ESNext",
|
||||
"module": "ES2020",
|
||||
"skipLibCheck": true,
|
||||
|
||||
/* Bundler mode */
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"skipLibCheck": true,
|
||||
"module": "ESNext",
|
||||
"module": "ES2020",
|
||||
"moduleResolution": "bundler",
|
||||
"allowSyntheticDefaultImports": true
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import { defineConfig } from 'vite';
|
||||
import react from '@vitejs/plugin-react-swc';
|
||||
import pluginChecker from 'vite-plugin-checker';
|
||||
import EnvironmentPlugin from 'vite-plugin-environment';
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
|
|
@ -8,6 +9,7 @@ export default defineConfig({
|
|||
plugins: [
|
||||
react(),
|
||||
pluginChecker({ typescript: true }),
|
||||
EnvironmentPlugin('all'),
|
||||
],
|
||||
preview: {
|
||||
port: 5173,
|
||||
|
|
|
|||
Loading…
Reference in a new issue