Both Mocha and Chai are integrated using
karma-chai respectively, so all APIs such as
expect are globally available in test files.
# Begin Karma npm run unit
my-project ├─ test | ├─ unit │ │ ├─ specs/ │ │ ├─ index.js └─ └─ └─ karma.conf.js
For the most part, you can ignore both
karma.conf.js and focus solely on writing
Inside this directory is where actual tests are written. Thanks to the power of webpack, you have full access to ES2015 and supported loaders.
This is the entry file used by
karma-webpack. The purpose of this file is to gather all test and source code in a "one-shot" manner.
Here you will find the actual
karma configuration, set up with spec/coverage reporters. Further customization can be made in accordance to the official karma documentation.