Skip to content

Commit

Permalink
fix(test-runner-mocha): move @types/mocha to dev dependency
Browse files Browse the repository at this point in the history
Having an `@types/*` package with global symbols like `it` and `describe` forces these global types on downstream consumers which may not use them. For example, Jasmine types overlap and conflict with Mocha types, but transitively including `@types/mocha` through `@web/test-runner-mocha` makes Jasmine impossible to use with Web Test Runner. See [this commit](angular/angular-cli@d95bb63) for a motivating example.
  • Loading branch information
dgp1130 committed Oct 31, 2023
1 parent 5a81704 commit 60dda46
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/twenty-pants-draw.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@web/test-runner-mocha': patch
---

Remove `@types/mocha` from dependencies so its global types don't leak into user code.
5 changes: 3 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/test-runner-mocha/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
"framework"
],
"dependencies": {
"@types/mocha": "^10.0.1",
"@web/test-runner-core": "^0.11.1"
},
"devDependencies": {
"@types/mocha": "^10.0.1",
"deepmerge": "^4.2.2",
"mocha": "^10.2.0"
}
Expand Down

0 comments on commit 60dda46

Please sign in to comment.