This directory contains the karma_mocha_test
Bazel rule, which is based on the karma_web_test
rule defined here.
The reason the karma_mocha_test
rule is necessary is because most JavaScript / TypeScript tests in this reposiory are written for the Mocha test framework, whereas the karma_web_test
rule makes the hard assumption that tests are written for the Jasmine framework, and does not provide a mechanism to override this.
The contents of this directory are copied from the //packages/karma
directory in the [rules_nodejs]((https://github.com/bazelbuild/rules_nodejs) repository with minimal changes to replace Jasmine with Mocha and to remove some features we do not need.
In the future we might consider migrating our tests to Jasmine so we can use the standard karma_web_test
rule and delete this directory.