Skip to content

Run cypress for react v18 and v19 #393

Description

@100terres

Currently our specs are done on our storybook app. With our current setup it will be diffulct to build storybook with a different react version then the one we have in the our package.json.

We've tried with some aliases, but it was not working since storybook code was expecting react 18.

  const reactMajorVersion = process.env.REACT_MAJOR_VERSION;
  const isOldReactVersion = ['16', '17'].includes(reactMajorVersion);
  const reactModuleSufix = isOldReactVersion ? `-${reactMajorVersion}` : '';

  webpackConfig.resolve.alias = {
    ...config.resolve.alias,
    react: require.resolve(`react${reactModuleSufix}`), // react-16 or react-17
    'react-dom': require.resolve(`react-dom${reactModuleSufix}`), // react-dom-16 or react-dom-17
  };

We'll need to move our cypress tests away from storybook and build a small app where we have full control over the configuration and can easily swap react versions.

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions