You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+43-6Lines changed: 43 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,8 +32,8 @@ Install the following dependencies if you don't have them installed yet.
32
32
33
33
Even though Visual Studio or Rider seem to be adequate IDEs for front-end development, they tend to be unreliable with the latest front-end frameworks, linting, and formatting.
34
34
Because of that, we have [extra recommendations](/docs/frontend/frontend-ide.md) to help you succeed even more at front-end development.
35
-
36
-
#### Step 1 - run the Vue.js development server
35
+
36
+
#### Step 1 - run the Vue.js development server
37
37
38
38
Navigate to `ServicePulse\src\Frontend` and:
39
39
@@ -46,6 +46,42 @@ If `npm run dev` fails with an error related to git submodules not being correct
46
46
47
47
After doing the above steps, navigate to the URL presented by the execution of the Vue.js application to see the ServicePulse application.
48
48
49
+
### Running automated tests
50
+
51
+
The frontend automated tests utilize Vitest as the testing framework and testing-library for testing utilities. Vitest provide two modes: `watch mode` in the development environment and `run mode` in the CI environment by default. `Watch mode` instantly re-runs relevant tests upon file save, providing immediate feedback during development.
52
+
53
+
Before running test, ensure you've set up the development server. Navigate to `ServicePulse\src\Frontend` and run `npm install` to install all the npm dependencies.
54
+
55
+
#### Running component tests
56
+
57
+
Navigate to `ServicePulse\src\Frontend` and run:
58
+
59
+
```console
60
+
npm run test:component
61
+
```
62
+
63
+
This command runs all the component test files `*.spcs.ts` in the directory `ServicePulse\src\Frontend\src` and its subdirectories. With `watch mode` enabled it allows for efficient test development, as only the relevant tests are re-run on file save.
64
+
65
+
#### Running application tests
66
+
67
+
Navigate to `ServicePulse\src\Frontend` and run:
68
+
69
+
```console
70
+
npm run test:application
71
+
```
72
+
73
+
Similar to component tests, this command runs all the application test files `*.spcs.ts` in the directory `ServicePulse\src\Frontend\test` and its subdirectories.
74
+
75
+
#### Running test coverage
76
+
77
+
Navigate to `ServicePulse\src\Frontend` and run:
78
+
79
+
```console
80
+
npm run test:coverage
81
+
```
82
+
83
+
This command generates a report indicating the percentage of statements, branches, function, and lines covered by tests. Additionally, it identifies uncovered line numbers.
84
+
49
85
### Provided npm scripts
50
86
51
87
#### Vue.js
@@ -55,10 +91,11 @@ After doing the above steps, navigate to the URL presented by the execution of t
55
91
-`lint` - checks with eslint all vue, ts, and js files
56
92
-`type-check` - runs TypeScript in no emit mode
57
93
94
+
#### Vitest
58
95
59
-
### Configuring automated tests
60
-
61
-
For information on running automated tests, please follow [ServicePulse.Host.Tests/Readme](https://github.com/Particular/ServicePulse/blob/master/src/ServicePulse.Host.Tests/README.md).
96
+
-`test:application` - runs all the application tests located in the `Frontend/test` folder.
97
+
-`test:component` - runs tests all the component tests located in the `Frontend/src` folder and any subdirectories.
98
+
-`test:coverage` - runs the test coverage report on the files defined in `vitest.config.ts`
62
99
63
100
## Running from ServicePulse.Host.exe
64
101
@@ -68,7 +105,7 @@ It is possible to run ServicePulse directly via `ServicePulse.Host.exe`.
68
105
69
106
ServicePulse.Host.exe depends on a self-hosted web server. A URL ACL reservation must be set up before the project can run. Either run Visual Studio with Administrative privileges or run the following command to add the required URL ACL reservation:
0 commit comments