Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Commit
•
ac4c3bc
1
Parent(s):
771ea1b
all tests pass
Browse files- README.md +19 -3
- package.json +3 -1
- playwright.config.ts +5 -5
README.md
CHANGED
@@ -102,17 +102,33 @@ I haven't setup Prettier or a Linter yet.
|
|
102 |
|
103 |
@jbilcke-hf is working to add tests, and will also act as the "QA engineer".
|
104 |
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
#### Unit tests
|
106 |
|
107 |
-
Note: I've just added Vitest
|
108 |
|
109 |
-
|
|
|
|
|
|
|
|
|
|
|
110 |
|
111 |
#### End-to-end tests
|
112 |
|
|
|
|
|
|
|
|
|
113 |
|
114 |
-
|
115 |
|
|
|
116 |
`npx playwright test`
|
117 |
Runs the end-to-end tests.
|
118 |
|
|
|
102 |
|
103 |
@jbilcke-hf is working to add tests, and will also act as the "QA engineer".
|
104 |
|
105 |
+
To run all the tests (unit and e2e) please run:
|
106 |
+
|
107 |
+
`npm test`
|
108 |
+
|
109 |
+
This is not instantaneous: playwright may seems to do nothing for a while at first.
|
110 |
+
|
111 |
#### Unit tests
|
112 |
|
113 |
+
Note: I've just added Vitest so we only have like 2 tests for now.
|
114 |
|
115 |
+
|
116 |
+
To run the test without watching, type:
|
117 |
+
`npm run test:unit:ci`
|
118 |
+
|
119 |
+
To run the tests with watching, type:
|
120 |
+
`npm run test:unit:watch`
|
121 |
|
122 |
#### End-to-end tests
|
123 |
|
124 |
+
Note: I've just added Playwright, but we don't really have tests yet.
|
125 |
+
|
126 |
+
Please note that due to the app needing to build during 30~60s (depending on the speed of your computer), running those tests may
|
127 |
+
take some time to execute.
|
128 |
|
129 |
+
`npm run test:e2e`
|
130 |
|
131 |
+
More Playwright commands:
|
132 |
`npx playwright test`
|
133 |
Runs the end-to-end tests.
|
134 |
|
package.json
CHANGED
@@ -9,7 +9,9 @@
|
|
9 |
"start": "next start",
|
10 |
"lint": "next lint",
|
11 |
"lint:fix": "next lint --fix",
|
12 |
-
"test:
|
|
|
|
|
13 |
"test:e2e": "npx playwright test"
|
14 |
},
|
15 |
"dependencies": {
|
|
|
9 |
"start": "next start",
|
10 |
"lint": "next lint",
|
11 |
"lint:fix": "next lint --fix",
|
12 |
+
"test": "npm run build && npm run test:unit:ci && npm run test:e2e",
|
13 |
+
"test:unit:ci": "vitest run",
|
14 |
+
"test:unit:watch": "vitest",
|
15 |
"test:e2e": "npx playwright test"
|
16 |
},
|
17 |
"dependencies": {
|
playwright.config.ts
CHANGED
@@ -70,9 +70,9 @@ export default defineConfig({
|
|
70 |
],
|
71 |
|
72 |
/* Run your local dev server before starting the tests */
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
});
|
|
|
70 |
],
|
71 |
|
72 |
/* Run your local dev server before starting the tests */
|
73 |
+
webServer: {
|
74 |
+
command: 'npm run start',
|
75 |
+
url: 'http://127.0.0.1:3000',
|
76 |
+
reuseExistingServer: !process.env.CI,
|
77 |
+
},
|
78 |
});
|