You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am import chai as chaiModule, but getting error like
import chaiModule from "chai";
^^^^^^^^^^
SyntaxError: The requested module 'chai' does not provide an export named 'default'
Code for Reference
import chaiModule from "chai";
import chaiHttp from "chai-http";
const chai = chaiModule.use(chaiHttp);
describe('Users API Testing', () => {
it('GET all the users', (done) => {
chai.request('http://localhost:3000')
.get('/')
.get('/api/users')
.end((err, res) => {
if (err) done(err);
expect(res).to.have.status(200);
expect(res.body).to.be.an('array');
done();
});
});
});
and when Import like
import * as chai from 'chai',
getting error - chai.request is not a function,
I tried different way to import , but getting same error.
The text was updated successfully, but these errors were encountered:
I am import chai as chaiModule, but getting error like
import chaiModule from "chai";
^^^^^^^^^^
SyntaxError: The requested module 'chai' does not provide an export named 'default'
Code for Reference
and when Import like
import * as chai from 'chai',
getting error - chai.request is not a function,
I tried different way to import , but getting same error.
The text was updated successfully, but these errors were encountered: