1

In test I run request using JSDOM with option 'runScripts'. Test passed but I get in console

'Cannot log after tests are done. Did you forget to wait for something async in your test?'

This is because scripts continues to run after test is done. What should I do, to don't get log this error to console? It is code that I run:

test('should run request without errors', done => {
  const options: BaseOptions = {
    resources: 'usable',
    runScripts: 'dangerously',
  };
  JSDOM.fromURL('http://localhost:3000/', options).then(dom => {
    setTimeout(function() {
      done();
    }, 60000);
  });
});

0 Answers0