I tried installing chai using the following command.
npm install
Then I ran the unit test class with the following imports.
import {assert} from 'chai'; import {expect} from 'chai';
It produces 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'
What am I doing wrong here? I see the chai folder inside the node_modules folder.
When I say var chai = require ('chai'); it works! why not import work?
javascript npm typescript node-modules chai
mayooran
source share