Skip to content

Commit

Permalink
test: create vitest workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgevrgs committed May 15, 2024
1 parent 7236739 commit b147c07
Show file tree
Hide file tree
Showing 10 changed files with 163 additions and 27 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ node_modules
/test-results/
/playwright-report/
/playwright/.cache/
vitest.config.mts.timestamp*
File renamed without changes.
5 changes: 3 additions & 2 deletions libs/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "",
"scripts": {
"lint": "eslint .",
"test": "echo \"Error: no test specified\" && exit 1"
"test": "vitest"
},
"keywords": [],
"author": "",
Expand All @@ -22,6 +22,7 @@
"@eslint/js": "^9.2.0",
"eslint": "8.57.0",
"globals": "^15.2.0",
"typescript-eslint": "^7.9.0"
"typescript-eslint": "^7.9.0",
"vitest": "1.6.0"
}
}
File renamed without changes.
11 changes: 6 additions & 5 deletions libs/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "",
"scripts": {
"lint": "eslint .",
"test": "echo \"Error: no test specified\" && exit 1"
"test": "vitest"
},
"keywords": [],
"author": "",
Expand All @@ -25,13 +25,14 @@
"react-use": "17.4.0"
},
"devDependencies": {
"@eslint/js": "^9.2.0",
"@testing-library/react": "13.4.0",
"@eslint/js": "9.2.0",
"@testing-library/react": "15.0.7",
"@vitejs/plugin-react": "4.2.1",
"eslint": "8.57.0",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-react": "7.34.1",
"globals": "^15.2.0",
"react-test-renderer": "18.2.0",
"typescript-eslint": "^7.9.0",
"typescript-eslint": "7.9.0",
"vitest": "1.6.0"
}
}
12 changes: 12 additions & 0 deletions libs/frontend/vitest.config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import react from '@vitejs/plugin-react';
import { defineConfig } from 'vitest/config';

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
test: {
environment: 'jsdom',
include: ['**/*.(test|spec).(ts|tsx)'],
exclude: ['**/node_modules/**', '**/*.e2e-spec.ts'],
},
});
3 changes: 1 addition & 2 deletions libs/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
"description": "",
"main": "index.js",
"scripts": {
"lint": "eslint .",
"test": "echo \"Error: no test specified\" && exit 1"
"lint": "eslint ."
},
"keywords": [],
"author": "",
Expand Down
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@
},
"devDependencies": {
"@playwright/test": "1.44.0",
"@testing-library/react": "13.4.0",
"@types/node": "18.7.16",
"autoprefixer": "10.4.9",
"eslint": "8.57.0",
"typescript": "5.4.5",
"vitest": "1.6.0"
}
Expand Down
148 changes: 133 additions & 15 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions vitest.workspace.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { defineWorkspace } from 'vitest/config';

export default defineWorkspace([
'./apps/nextjs/vitest.config.mts',
'./libs/frontend/vitest.config.mts',
'./libs/backend/vitest.config.mts',
]);

0 comments on commit b147c07

Please sign in to comment.