cleanup(storybook): re-enable unit tests (#14639)
This commit is contained in:
parent
5e2f3154b1
commit
0650ee96d5
@ -48,38 +48,7 @@ describe('Storybook generators for nested workspaces', () => {
|
|||||||
return json;
|
return json;
|
||||||
});
|
});
|
||||||
|
|
||||||
// TODO(katerina): Once Storybook vite generators are fixed, remove this.
|
|
||||||
updateJson('package.json', (json) => {
|
|
||||||
json['devDependencies'] = {
|
|
||||||
...json['devDependencies'],
|
|
||||||
'@storybook/builder-vite': '0.2.5',
|
|
||||||
};
|
|
||||||
return json;
|
|
||||||
});
|
|
||||||
|
|
||||||
runCommand(getPackageManagerCommand().install);
|
runCommand(getPackageManagerCommand().install);
|
||||||
|
|
||||||
// TODO(katerina): Once Storybook vite generators are fixed, remove this.
|
|
||||||
updateFile(
|
|
||||||
'./storybook/main.js',
|
|
||||||
`const rootMain = require(‘./main.root’);
|
|
||||||
module.exports = {
|
|
||||||
…rootMain,
|
|
||||||
core: { …rootMain.core, builder: ‘@storybook/builder-vite’ },
|
|
||||||
stories: [
|
|
||||||
…rootMain.stories,
|
|
||||||
‘../src/app/**/*.stories.mdx’,
|
|
||||||
‘../src/app/**/*.stories.@(js|jsx|ts|tsx)’,
|
|
||||||
],
|
|
||||||
addons: […rootMain.addons, ‘@nrwl/react/plugins/storybook’],
|
|
||||||
webpackFinal: async (config, { configType }) => {
|
|
||||||
if (rootMain.webpackFinal) {
|
|
||||||
config = await rootMain.webpackFinal(config, { configType });
|
|
||||||
}
|
|
||||||
return config;
|
|
||||||
},
|
|
||||||
};`
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
afterAll(() => {
|
afterAll(() => {
|
||||||
@ -115,7 +84,10 @@ describe('Storybook generators for nested workspaces', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// TODO: Figure out why this is failing on Node 18 (md4 is being used with webpack even though we're using vite)
|
// TODO: Re-enable this test when Nx uses only Storybook 7 (Nx 16)
|
||||||
|
// This fails for Node 18 because Storybook 6.5 uses webpack even in non-webpack projects
|
||||||
|
// https://github.com/storybookjs/builder-vite/issues/414#issuecomment-1287536049
|
||||||
|
// https://github.com/storybookjs/storybook/issues/20209
|
||||||
// Error: error:0308010C:digital envelope routines::unsupported
|
// Error: error:0308010C:digital envelope routines::unsupported
|
||||||
xdescribe('serve storybook', () => {
|
xdescribe('serve storybook', () => {
|
||||||
afterEach(() => killPorts());
|
afterEach(() => killPorts());
|
||||||
@ -129,7 +101,10 @@ describe('Storybook generators for nested workspaces', () => {
|
|||||||
}, 1000000);
|
}, 1000000);
|
||||||
});
|
});
|
||||||
|
|
||||||
// TODO: Figure out why this is failing on Node 18 (md4 is being used with webpack even though we're using vite)
|
// TODO: Re-enable this test when Nx uses only Storybook 7 (Nx 16)
|
||||||
|
// This fails for Node 18 because Storybook 6.5 uses webpack even in non-webpack projects
|
||||||
|
// https://github.com/storybookjs/builder-vite/issues/414#issuecomment-1287536049
|
||||||
|
// https://github.com/storybookjs/storybook/issues/20209
|
||||||
// Error: error:0308010C:digital envelope routines::unsupported
|
// Error: error:0308010C:digital envelope routines::unsupported
|
||||||
xdescribe('build storybook', () => {
|
xdescribe('build storybook', () => {
|
||||||
it('should build and lint a React based storybook', () => {
|
it('should build and lint a React based storybook', () => {
|
||||||
|
|||||||
@ -8,10 +8,9 @@ import {
|
|||||||
import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing';
|
import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing';
|
||||||
|
|
||||||
import configurationGenerator from './configuration';
|
import configurationGenerator from './configuration';
|
||||||
import * as rootProjectConfiguration from './test-configs/root-project-configuration.json';
|
|
||||||
import * as workspaceConfiguration from './test-configs/root-workspace-configuration.json';
|
import * as workspaceConfiguration from './test-configs/root-workspace-configuration.json';
|
||||||
|
|
||||||
xdescribe('@nrwl/storybook:configuration for workspaces with Root project', () => {
|
describe('@nrwl/storybook:configuration for workspaces with Root project', () => {
|
||||||
describe('basic functionalities', () => {
|
describe('basic functionalities', () => {
|
||||||
let tree: Tree;
|
let tree: Tree;
|
||||||
|
|
||||||
@ -23,8 +22,7 @@ xdescribe('@nrwl/storybook:configuration for workspaces with Root project', () =
|
|||||||
};
|
};
|
||||||
return json;
|
return json;
|
||||||
});
|
});
|
||||||
|
writeConfig(tree, workspaceConfiguration);
|
||||||
writeJson(tree, 'project.json', rootProjectConfiguration);
|
|
||||||
writeJson(tree, 'tsconfig.json', {
|
writeJson(tree, 'tsconfig.json', {
|
||||||
extends: './tsconfig.base.json',
|
extends: './tsconfig.base.json',
|
||||||
compilerOptions: {
|
compilerOptions: {
|
||||||
@ -63,7 +61,6 @@ xdescribe('@nrwl/storybook:configuration for workspaces with Root project', () =
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
writeConfig(tree, workspaceConfiguration);
|
|
||||||
writeJson(tree, 'package.json', {
|
writeJson(tree, 'package.json', {
|
||||||
devDependencies: {
|
devDependencies: {
|
||||||
'@storybook/addon-essentials': '~6.2.9',
|
'@storybook/addon-essentials': '~6.2.9',
|
||||||
|
|||||||
@ -31,7 +31,7 @@ const runAngularStorybookSchematic = wrapAngularDevkitSchematic(
|
|||||||
'storybook-configuration'
|
'storybook-configuration'
|
||||||
);
|
);
|
||||||
|
|
||||||
xdescribe('migrate-stories-to-6-2 schematic', () => {
|
describe('migrate-stories-to-6-2 schematic', () => {
|
||||||
let appTree: Tree;
|
let appTree: Tree;
|
||||||
|
|
||||||
describe('angular project', () => {
|
describe('angular project', () => {
|
||||||
|
|||||||
@ -24,7 +24,7 @@ const runAngularStorybookSchematic = wrapAngularDevkitSchematic(
|
|||||||
'storybook-configuration'
|
'storybook-configuration'
|
||||||
);
|
);
|
||||||
|
|
||||||
xdescribe('testing utilities', () => {
|
describe('testing utilities', () => {
|
||||||
describe('Test functions that need workspace tree', () => {
|
describe('Test functions that need workspace tree', () => {
|
||||||
let appTree: Tree;
|
let appTree: Tree;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user