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
Current Jest configuration is using testEnvironment: 'jest-environment-jsdom-sixteen' which means that all tests are run in a valid DOM environment.
This is problematic as CozyClient can be used in a Node.js environment (i.e. connectors' jobs)
A recent consequence from this configuration is that we are not able to correctly test the securiseUri method that is based on window global object. This method should not throw in Node.js environment which doesn't declare the window global object.
Because tests are run using jest-environment-jsdom-sixteen, all tests were success in #1176
But the method was still failing in Node.js environment. So we fixed that in #1180 but without ability to add a unit test to validate the change.
A good way to resolve this would be to run tests 2 times. One time with the jest-environment-jsdom-sixteen environment, and another time with the node environment.
But here a lot of existing tests would fail as some of them are not supposed to be run in node environment.
We should find a way to discriminate node only tests and DOM only tests.
The text was updated successfully, but these errors were encountered:
Current Jest configuration is using
testEnvironment: 'jest-environment-jsdom-sixteen'
which means that all tests are run in a valid DOM environment.This is problematic as CozyClient can be used in a Node.js environment (i.e. connectors' jobs)
A recent consequence from this configuration is that we are not able to correctly test the
securiseUri
method that is based onwindow
global object. This method should not throw in Node.js environment which doesn't declare thewindow
global object.Because tests are run using
jest-environment-jsdom-sixteen
, all tests were success in #1176But the method was still failing in Node.js environment. So we fixed that in #1180 but without ability to add a unit test to validate the change.
A good way to resolve this would be to run tests 2 times. One time with the
jest-environment-jsdom-sixteen
environment, and another time with thenode
environment.But here a lot of existing tests would fail as some of them are not supposed to be run in
node
environment.We should find a way to discriminate
node
only tests andDOM
only tests.The text was updated successfully, but these errors were encountered: