Skip to content

Commit 112d712

Browse files
authored
add a unit test (#203)
* add vitest Signed-off-by: Matthew F Leader <mleader@redhat.com> * rewrite formatDate() and add unit test Signed-off-by: Matthew F Leader <mleader@redhat.com> * change verb Signed-off-by: Matthew F Leader <mleader@redhat.com> * add package lock back to root Signed-off-by: Matthew F Leader <mleader@redhat.com> * simplify test cases Signed-off-by: Matthew F Leader <mleader@redhat.com> * rm test Signed-off-by: Matthew F Leader <mleader@redhat.com> * rm time zone and locale env vars Signed-off-by: Matthew F Leader <mleader@redhat.com> * add ci check Signed-off-by: Matthew F Leader <mleader@redhat.com> * add unit test job Signed-off-by: Matthew F Leader <mleader@redhat.com> * forgot run Signed-off-by: Matthew F Leader <mleader@redhat.com> --------- Signed-off-by: Matthew F Leader <mleader@redhat.com>
1 parent 21f09fb commit 112d712

File tree

7 files changed

+726
-11
lines changed

7 files changed

+726
-11
lines changed

.github/workflows/frontend-check.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ on:
55
- main
66
pull_request:
77
jobs:
8+
unit-tests:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: checkout project
12+
uses: actions/checkout@v4
13+
- name: build tests image
14+
run: podman build -t e2e-frontend -f frontend/e2e_frontend.containerfile ./frontend
15+
- name: run unit tests
16+
run: podman run --rm -it e2e-frontend run test:unit
17+
818
e2e-tests:
919
runs-on: ubuntu-latest
1020
env:

frontend/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,23 @@ Then, copy the `build` folder to the proper place on the server for deployment.
5656

5757
## Test
5858

59+
### Unit Tests
60+
61+
#### Requirements
62+
- Starting directory is the project root
63+
- NodeJS 22+
64+
65+
Install JavaScript dependencies.
66+
67+
```shell
68+
npm --prefix frontend install
69+
```
70+
71+
```shell
72+
npm --prefix frontend test
73+
```
74+
75+
5976
### Component Tests
6077

6178
#### Requirements

0 commit comments

Comments
 (0)