when i require module like this
const chai = require('chai');
const expect = chai.expect;
chai.use(require('chai-http'));
when i run the test case i am getting this error
my project is all depending on require so i can't go to import
Error [ERR_REQUIRE_ESM]: require() of ES Module /home/nanagoudt/numo_backend_repos/multitenant-cpuptime-service/node_modules/chai-http/index.js from /home/nanagoudt/numo_backend_repos/multitenant-cpuptime-service/test/write-status-logs.test.js not supported.
Instead change the require of index.js in /home/nanagoudt/numo_backend_repos/multitenant-cpuptime-service/test/write-status-logs.test.js to a dynamic import() which is available in all CommonJS modules.
when i require module like this const chai = require('chai'); const expect = chai.expect; chai.use(require('chai-http'));
when i run the test case i am getting this error my project is all depending on require so i can't go to import Error [ERR_REQUIRE_ESM]: require() of ES Module /home/nanagoudt/numo_backend_repos/multitenant-cpuptime-service/node_modules/chai-http/index.js from /home/nanagoudt/numo_backend_repos/multitenant-cpuptime-service/test/write-status-logs.test.js not supported. Instead change the require of index.js in /home/nanagoudt/numo_backend_repos/multitenant-cpuptime-service/test/write-status-logs.test.js to a dynamic import() which is available in all CommonJS modules.