Skip to content

Commit 4cb8f0a

Browse files
Add Jest and test AppFiltersComponent
1 parent d72b12d commit 4cb8f0a

File tree

6 files changed

+4825
-182
lines changed

6 files changed

+4825
-182
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ mavis/reporting/static/js/*
2424
mavis/reporting/static/favicons/*
2525
!mavis/reporting/static/favicons/.keep
2626

27+
coverage/
2728
.coverage
2829
htmlcov
2930
coverage.svg

jest.config.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
export default {
2+
testEnvironment: "jsdom",
3+
transform: {},
4+
moduleNameMapper: {
5+
"^(\\.{1,2}/.*)\\.js$": "$1",
6+
},
7+
testMatch: ["**/tests/javascript/**/*.test.js"],
8+
collectCoverage: true,
9+
collectCoverageFrom: [
10+
"mavis/reporting/javascript/**/*.js",
11+
"!mavis/reporting/javascript/app.js",
12+
],
13+
};
14+

mise.toml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,13 @@ run = "mise dev:scss ::: dev:js ::: dev:flask"
100100

101101
[tasks.test]
102102
description = "Run all tests"
103-
depends = ["uv:sync"]
104-
run = ["uv run pytest tests"]
103+
depends = ["uv:sync", "npm:install"]
104+
run = ["uv run pytest tests", "npm run test:js"]
105+
106+
[tasks."test:js"]
107+
description = "Run JavaScript tests"
108+
depends = ["npm:install"]
109+
run = "npm run test:js"
105110

106111
[tasks."test:coverage"]
107112
description = "Run tests with coverage reporting"
@@ -139,7 +144,7 @@ run = "MISE_SOPS_AGE_KEY=$(cat config/credentials/staging.key) mise docker:run"
139144

140145
[tasks.ci]
141146
description = "Run CI checks in parallel"
142-
depends = ["gitleaks", "lint", "test", "typecheck"]
147+
depends = ["gitleaks", "lint", "test", "typecheck", "test:js"]
143148

144149
[tasks."credentials:show"]
145150
description = "Show credentials"

0 commit comments

Comments
 (0)