Attempting to install chai through the command line, I used the following command.
npm install --save-dev chai
After that, I attempted to run my unit test class with the specified imports:
import {assert} from 'chai';
import {expect} from 'chai';
However, it resulted in the following errors:
test\main\MessageBroker.spec.ts(3,22): error TS2307: Cannot find module 'chai'.
[05:38:45] [Typescript] TypeScript error: test\main\MessageBroker.spec.ts(3,22): error TS2307: Cannot find module 'chai'.
test\main\MessageBroker.spec.ts(4,22): error TS2307: Cannot find module 'chai'.
[05:38:45] [Typescript] TypeScript error: test\main\MessageBroker.spec.ts(4,22): error TS2307: Cannot find module 'chai'
I'm wondering what mistake I might be making here. The chai folder is present inside the node_modules directory.
Interestingly, using var chai = require('chai'); seems to work fine! Why isn't the import statement working as expected?