mercredi 11 novembre 2020

Test suite failed to run. ReferenceError: window is not defined

This is my test file

import React from 'react';
import ReactDom from 'react-dom';
import AccessSeeker from './AccessSeeker';
test('renders', () => {
})

I am getting this error:

Test suite failed to run

    ReferenceError: window is not defined

      at node_modules/pikaday/pikaday.js:38:25
      at node_modules/pikaday/pikaday.js:16:26
      at Object.<anonymous> (node_modules/pikaday/pikaday.js:29:2)
      at Object.<anonymous> (src/components/DatePicker.js:2:16)

Because of this line:

import AccessSeeker from './AccessSeeker';

Aucun commentaire:

Enregistrer un commentaire