Skip to content

Commit

Permalink
Upgrade Vitest
Browse files Browse the repository at this point in the history
  • Loading branch information
Shmulik-Kravitz committed Nov 27, 2023
1 parent 03130cf commit ad900b9
Show file tree
Hide file tree
Showing 9 changed files with 589 additions and 489 deletions.
3 changes: 3 additions & 0 deletions config/vitest/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"type": "module"
}
21 changes: 21 additions & 0 deletions config/vitest/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { configDefaults, defineConfig } from 'vitest/config';
import react from '@vitejs/plugin-react';
import filterConsole from '../utils/filterConsoleUtils';
const disableFilter = filterConsole(['MODULE_NOT_FOUND']);

export const getConfig = () => defineConfig({
plugins: [react()],
test: {
globals: true,
watch: false,
// globalSetup: __dirname + '/vitest.setup.ts',
setupFiles: "@testing-library/jest-dom",
environment: 'jsdom',
coverage: {
reporter: ['text', 'json', 'html', 'cobertura'],
exclude: ['**/.pnp.*'],

},
exclude: [...configDefaults.exclude, '**/.pnp.*'],
},
})
9 changes: 9 additions & 0 deletions config/vitest/vitest.setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import "@testing-library/jest-dom";
import filterConsole from "../utils/filterConsoleUtils";

export const setup = () => {
const disableFilter = filterConsole(['MODULE_NOT_FOUND']);
};
export const teardown = () => {

};
13 changes: 6 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,21 @@
"@types/node": "^16.18.11",
"@types/react": "^18.0.26",
"@types/react-dom": "^18.0.10",
"@vitejs/plugin-react": "^3.0.1",
"@vitest/coverage-c8": "^0.27.1",
"esbuild": "^0.16.17",
"esbuild-node-externals": "^1.6.0",
"@vitejs/plugin-react": "^4.2.0",
"@vitest/coverage-v8": "^0.34.6",
"esbuild": "^0.19.8",
"esbuild-node-externals": "^1.11.0",
"esbuild-runner": "^2.2.2",
"esprima": "^4.0.1",
"has-flag": "4.0.0",
"jsdom": "^21.0.0",
"jsdom": "^23.0.0",
"prettier": "^2.8.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rimraf": "^3.0.2",
"tsc-prog": "^2.2.1",
"typescript": "^4.9.3",
"vite": "^4.0.5",
"vitest": "^0.27.1"
"vitest": "1.0.0-beta.4"
},
"resolutions": {
"node-notifier": "8.0.1"
Expand Down
3 changes: 3 additions & 0 deletions packages/jewishDatesCore/config/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"type": "module"
}
2 changes: 1 addition & 1 deletion packages/jewishDatesCore/config/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import {getConfig} from "../../../config/vitest.config";
import {getConfig} from "../../../config/vitest/vitest.config";
const config = getConfig();
export default config;
3 changes: 3 additions & 0 deletions packages/reactJewishDatePicker/config/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"type": "module"
}
2 changes: 1 addition & 1 deletion packages/reactJewishDatePicker/config/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import {getConfig} from "../../../config/vitest.config";
import {getConfig} from "../../../config/vitest/vitest.config";
const config = getConfig();
export default config;
Loading

0 comments on commit ad900b9

Please sign in to comment.