fix(nextjs): re-enable storybook test (#20074)
This commit is contained in:
parent
457bbcbe57
commit
8730395082
@ -2,13 +2,16 @@ import {
|
|||||||
checkFilesExist,
|
checkFilesExist,
|
||||||
cleanupProject,
|
cleanupProject,
|
||||||
getPackageManagerCommand,
|
getPackageManagerCommand,
|
||||||
|
getSelectedPackageManager,
|
||||||
newProject,
|
newProject,
|
||||||
runCLI,
|
runCLI,
|
||||||
runCommand,
|
runCommand,
|
||||||
uniq,
|
uniq,
|
||||||
updateJson,
|
|
||||||
} from '@nx/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
|
|
||||||
|
const pmc = getPackageManagerCommand({
|
||||||
|
packageManager: getSelectedPackageManager(),
|
||||||
|
});
|
||||||
describe('Next.js Storybook', () => {
|
describe('Next.js Storybook', () => {
|
||||||
let proj: string;
|
let proj: string;
|
||||||
|
|
||||||
@ -16,8 +19,7 @@ describe('Next.js Storybook', () => {
|
|||||||
|
|
||||||
afterAll(() => cleanupProject());
|
afterAll(() => cleanupProject());
|
||||||
|
|
||||||
// TODO (@mandarini): Re-enable this test
|
it('should run a Next.js based Storybook setup', async () => {
|
||||||
xit('should run a Next.js based Storybook setup', async () => {
|
|
||||||
const appName = uniq('app');
|
const appName = uniq('app');
|
||||||
|
|
||||||
runCLI(`generate @nx/next:app ${appName} --no-interactive`);
|
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`
|
`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(
|
runCLI(
|
||||||
`generate @nx/react:storybook-configuration ${appName} --generateStories --no-interactive`,
|
`generate @nx/react:storybook-configuration ${appName} --generateStories --no-interactive`
|
||||||
{
|
|
||||||
silenceError: true,
|
|
||||||
}
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// 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}`);
|
runCLI(`build-storybook ${appName}`);
|
||||||
checkFilesExist(`dist/storybook/${appName}/index.html`);
|
checkFilesExist(`dist/storybook/${appName}/index.html`);
|
||||||
}, 1_000_000);
|
}, 1_000_000);
|
||||||
|
|||||||
@ -50,6 +50,19 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"packageJsonUpdates": {
|
"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": {
|
"17.1.0": {
|
||||||
"version": "17.1.0-beta.3",
|
"version": "17.1.0-beta.3",
|
||||||
"packages": {
|
"packages": {
|
||||||
|
|||||||
@ -2,8 +2,8 @@ export const nxVersion = require('../../package.json').version;
|
|||||||
export const storybookReactNativeVersion = '^6.5.3';
|
export const storybookReactNativeVersion = '^6.5.3';
|
||||||
export const reactNativeStorybookLoader = '^2.0.5';
|
export const reactNativeStorybookLoader = '^2.0.5';
|
||||||
export const storybookTestRunnerVersion = '^0.13.0';
|
export const storybookTestRunnerVersion = '^0.13.0';
|
||||||
export const storybookTestingLibraryVersion = '~0.2.0';
|
export const storybookTestingLibraryVersion = '^0.2.2';
|
||||||
export const storybookJestVersion = '~0.1.0';
|
export const storybookJestVersion = '^0.2.3';
|
||||||
export const litVersion = '^2.6.1';
|
export const litVersion = '^2.6.1';
|
||||||
export const tsNodeVersion = '10.9.1';
|
export const tsNodeVersion = '10.9.1';
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user