From 9bc708407f6d20ac8c08488bcad4bb40e99729f2 Mon Sep 17 00:00:00 2001 From: Martin Hochel Date: Wed, 15 May 2024 12:14:40 +0200 Subject: [PATCH] test: accomodate bundle size changes within preview-initial-release if in split mode --- .../prepare-initial-release/index.spec.ts | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tools/workspace-plugin/src/generators/prepare-initial-release/index.spec.ts b/tools/workspace-plugin/src/generators/prepare-initial-release/index.spec.ts index 72a8cc1c7c1331..f1644da4e70544 100644 --- a/tools/workspace-plugin/src/generators/prepare-initial-release/index.spec.ts +++ b/tools/workspace-plugin/src/generators/prepare-initial-release/index.spec.ts @@ -624,6 +624,18 @@ describe('prepare-initial-release generator', () => { files: { library: [], stories: [ + { + filePath: 'packages/react-one-preview/library/bundle-size/index.fixture.js', + content: stripIndents` + import {One} from '@proj/react-one-preview'; + + console.log(One); + + export default { + name: '@proj/react-one-preview - package', + } + `, + }, { filePath: 'packages/react-one-preview/stories/src/One.stories.tsx', content: stripIndents` @@ -717,6 +729,18 @@ describe('prepare-initial-release generator', () => { }), ); + expect(utils.project.library.bundleSize()).toMatchInlineSnapshot(` + Object { + "packages/react-one/library/bundle-size/index.fixture.js": "import { One } from '@proj/react-one'; + + console.log(One); + + export default { + name: '@proj/react-one - package', + };", + } + `); + expect(utils.project.library.md.readme()).toMatchInlineSnapshot(` "# @proj/react-one