Closed stormwind85 closed 4 years ago
I've tried to run my tests using the Supertest library, that includes Superagent library.
Here is a basic example of test I want to execute in my project.
const messageObj = { id: "123456", message: "blablabla" }; const headers = { "Content-Type": "application/json", }; await supertest .post('/') .send(messageObj) .set(headers) .expect(200);
I run my tests with the following command : yarn run jest your_test_file.test.js
yarn run jest your_test_file.test.js
I got an exception with this and here is the error message :
TypeError: mime.lookup is not a function
And this error refers to the send() function because if I'm running the same test without sending data (without using send() function), it works !
send()
So, could you please check about your send() function because I can't use it anymore during my tests.
I notice that it has been fixed after doing a yarn install.
yarn install
Therefore, I'm closing this issue.
I've tried to run my tests using the Supertest library, that includes Superagent library.
Here is a basic example of test I want to execute in my project.
I run my tests with the following command :
yarn run jest your_test_file.test.js
I got an exception with this and here is the error message :
And this error refers to the
send()
function because if I'm running the same test without sending data (without usingsend()
function), it works !So, could you please check about your
send()
function because I can't use it anymore during my tests.