Skip to content
devlinjunker edited this page Apr 21, 2020 · 3 revisions

Test

Testing bootstrap file(github) finds all of the test files and imports global objects that can be used in all tests to simplify each test file. Also creates a sinon Sandbox that is reset before each test for mocking/stubbing services and non-tested functions in the test context.

To run the tests with mocha, use npm run test to see the output from all tests in .spec files in the standard output.

Global Imports (available in all .spec files):

  • sinonSandbox from Sinon
  • expect from Chai
  • describe/it/beforeEach from Mocha

Notes/Ideas

  • Look into differences between webpack tests vs npm test
  • IDEA: Mocha settings/plugin for displaying filepath in output of tests (when erroring?)
    • seems difficult to do on async/timeout errors
Clone this wiki locally