fix(nextjs): re-enable storybook test (#20074)

This commit is contained in:
Katerina Skroumpelou 2023-11-07 16:32:05 +02:00 committed by GitHub
parent 457bbcbe57
commit 8730395082
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 10 deletions

View File

@ -2,13 +2,16 @@ import {
checkFilesExist,
cleanupProject,
getPackageManagerCommand,
getSelectedPackageManager,
newProject,
runCLI,
runCommand,
uniq,
updateJson,
} from '@nx/e2e/utils';
const pmc = getPackageManagerCommand({
packageManager: getSelectedPackageManager(),
});
describe('Next.js Storybook', () => {
let proj: string;
@ -16,8 +19,7 @@ describe('Next.js Storybook', () => {
afterAll(() => cleanupProject());
// TODO (@mandarini): Re-enable this test
xit('should run a Next.js based Storybook setup', async () => {
it('should run a Next.js based Storybook setup', async () => {
const appName = uniq('app');
runCLI(`generate @nx/next:app ${appName} --no-interactive`);
@ -25,14 +27,14 @@ describe('Next.js Storybook', () => {
`generate @nx/next:component Foo --project=${appName} --no-interactive`
);
// Currently due to auto-installing peer deps in pnpm, the generator can fail while installing deps with unmet peet deps.
runCLI(
`generate @nx/react:storybook-configuration ${appName} --generateStories --no-interactive`,
{
silenceError: true,
}
`generate @nx/react:storybook-configuration ${appName} --generateStories --no-interactive`
);
// It seems that we need to run install twice for some reason.
// This is only true on CI. On normal repos, it works as expected.
runCommand(pmc.install);
runCLI(`build-storybook ${appName}`);
checkFilesExist(`dist/storybook/${appName}/index.html`);
}, 1_000_000);

View File

@ -50,6 +50,19 @@
}
},
"packageJsonUpdates": {
"17.1.0-beta.4": {
"version": "17.1.0-beta.4",
"packages": {
"@storybook/testing-library": {
"version": "^0.2.2",
"alwaysAddToPackageJson": false
},
"@storybook/jest": {
"version": "^0.2.3",
"alwaysAddToPackageJson": false
}
}
},
"17.1.0": {
"version": "17.1.0-beta.3",
"packages": {

View File

@ -2,8 +2,8 @@ export const nxVersion = require('../../package.json').version;
export const storybookReactNativeVersion = '^6.5.3';
export const reactNativeStorybookLoader = '^2.0.5';
export const storybookTestRunnerVersion = '^0.13.0';
export const storybookTestingLibraryVersion = '~0.2.0';
export const storybookJestVersion = '~0.1.0';
export const storybookTestingLibraryVersion = '^0.2.2';
export const storybookJestVersion = '^0.2.3';
export const litVersion = '^2.6.1';
export const tsNodeVersion = '10.9.1';