Skip to content

Commit a84e084

Browse files
committed
refine test scripts
1 parent ad744f8 commit a84e084

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Files:
1111
- [src/App.jsx](./src/App.jsx) setup `binding` and `UIMetaProvider`
1212
- [src/t.jsx](./src/t.jsx) dictionary setup
1313

14-
Run on [CodeSandbox](https://codesandbox.io/s/github/ui-schema/demo-cra/tree/master/?autoresize=1&fontsize=12&hidenavigation=1&module=%2Fsrc%2FApp.jsx) or [StackBlitz](https://stackblitz.com/github/ui-schema/demo-cra).
14+
Run on [CodeSandbox](https://codesandbox.io/s/github/ui-schema/demo-cra/tree/master/?autoresize=1&fontsize=12&hidenavigation=1&module=%2Fsrc%2FApp.jsx) or [StackBlitz](https://stackblitz.com/github/ui-schema/demo-cra?file=%2Fsrc%2FApp.jsx).
1515

1616
Explore more:
1717

@@ -50,3 +50,9 @@ Then run tests:
5050
```shell
5151
npm test
5252
```
53+
54+
Or run tests in watch mode:
55+
56+
```shell
57+
npm run tdd
58+
```

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
},
3333
"scripts": {
3434
"start": "cross-env NODE_ENV=development vite",
35-
"prebuild": "vitest run --coverage",
3635
"build": "cross-env NODE_ENV=production vite build",
37-
"test": "vitest"
36+
"test": "vitest run --coverage",
37+
"tdd": "vitest"
3838
}
3939
}

src/App.test.jsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { expect, test } from 'vitest'
2-
import React from 'react';
32
import { render } from 'vitest-browser-react'
43
import App from './App';
54

@@ -12,10 +11,6 @@ test('renders header', async () => {
1211
test('Form is interactive', async () => {
1312
const {getByText} = render(<App/>);
1413

15-
// full test:
16-
// - check that `Form is invalid.` exists in dom
17-
// - toggle the element of "Center Item Content"
18-
// - check that `Form is valid.` exists in dom
1914
const invalidText = getByText(/Form is invalid./i);
2015
await expect.element(invalidText).toBeInTheDocument();
2116

src/components/DemoEditor.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ const AppEditor = () => {
202202
<Typography
203203
variant={'body2'}
204204
sx={{
205-
// mack background semantic using mui theme
206205
backgroundColor: invalid ? 'error.main' : 'success.main',
207206
color: invalid ? 'error.contrastText' : 'success.contrastText',
208207
p: 1,

0 commit comments

Comments
 (0)