Skip to content

Commit c0cd9e7

Browse files
test: Add Vitest (#132)
1 parent 74ec81c commit c0cd9e7

File tree

13 files changed

+487
-33
lines changed

13 files changed

+487
-33
lines changed

.github/workflows/build.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,14 @@ jobs:
2121
- name: Install dependencies
2222
run: npm ci
2323

24+
- name: Run Vitest Tests
25+
run: npm run test:vi
26+
2427
- name: Build
2528
run: npm run build
2629

2730
- name: Run Cypress Tests
28-
run: npm run test
31+
run: npm run test:cy
2932

3033
- name: Upload Cypress Screenshots
3134
if: always() # Run this step even if tests fail
@@ -36,4 +39,3 @@ jobs:
3639
cypress/screenshots/
3740
retention-days: 7 # Keep artifacts for 7 days
3841
if-no-files-found: warn # Warn instead of fail if no screenshots found
39-

cypress.config.ts

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,22 @@
1-
import {defineConfig} from "cypress";
1+
import { defineConfig } from 'cypress';
22

3-
import {defineConfig as defineViteConfig} from 'vite';
3+
import { defineConfig as defineViteConfig } from 'vite';
44

55
import react from '@vitejs/plugin-react';
66

77
const viteConfig = defineViteConfig({
8-
plugins: [
9-
react(),
10-
],
8+
plugins: [react()],
119
});
1210
export default defineConfig({
1311
includeShadowDom: true,
1412
viewportWidth: 1920,
1513
viewportHeight: 1080,
1614
component: {
1715
devServer: {
18-
framework: "react",
19-
bundler: "vite",
16+
framework: 'react',
17+
bundler: 'vite',
2018
viteConfig: viteConfig,
2119
},
22-
specPattern: "**/*.test.{js,ts,jsx,tsx}",
23-
},
24-
25-
e2e: {
26-
baseUrl: "http://localhost:5173/",
27-
setupNodeEvents() {
28-
// implement node event listeners here
29-
},
20+
specPattern: '**/*.cy.{js,ts,jsx,tsx}',
3021
},
3122
});

0 commit comments

Comments
 (0)