Open mfendeksilverstripe opened 2 years ago
Note that you may be able to get jest tests limping along by making the following changes:
{
"devDependencies":
{
+ "react-16": "npm:react@^16.14.0",
+ "react-dom-16": "npm:react-dom@^16.14.0",
},
"jest": {
+ "testEnvironment": "jsdom",
+ "moduleNameMapper": {
+ "^react-dom/client$": "react-dom-16",
+ "^react-dom((/.*)?)$": "react-dom-16$1",
+ "^react((/.*)?)$": "react-16$1"
}
}
Though note that that's a very hacky workaround, and results in testing how the components would work with react 16, not how they do work with react 18.
See PRs attached to https://github.com/silverstripe/silverstripe-admin/issues/1419 and the discussion in that issue for how we tackled updating our jest tests for the supported modules.
Failing JS tests
Looks like some of our JS tests are failing. This was noticed as a part of https://github.com/silverstripe/silverstripe-versioned-snapshot-admin/pull/86 which made the JS tests to be executed via Github actions.
This is likely outdated test setup, not necessarily broken functionality. We should consider working on this in the context of https://github.com/silverstripe/silverstripe-versioned-snapshot-admin/issues/47 which may change a lot of tests.
The whole test suite was disabled as it's very outdated. We need to re-enable it once the tests are updated. Example of dependency errors that occur: