understand nested dependencies
This commit is contained in:
parent
b618a613ea
commit
93983476f8
|
|
@ -173,7 +173,12 @@ export async function buildBundle(config: FullConfig, configDir: string): Promis
|
|||
|
||||
{
|
||||
for (const [importingFile, components] of componentsByImportingFile) {
|
||||
setExternalDependencies(importingFile, components)
|
||||
const deps = new Set<string>();
|
||||
for (const component of components) {
|
||||
for (const d of buildInfo.deps[component])
|
||||
deps.add(d);
|
||||
}
|
||||
setExternalDependencies(importingFile, [...deps]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -152,8 +152,12 @@ test('should suppport component tests', async ({ runInlineTest, setupRepository,
|
|||
'playwright/index.html': `<script type="module" src="./index.ts"></script>`,
|
||||
'playwright/index.ts': `
|
||||
`,
|
||||
'src/contents.ts': `
|
||||
export const content = "Button";
|
||||
`,
|
||||
'src/button.tsx': `
|
||||
export const Button = () => <button>Button</button>;
|
||||
import {content} from './contents';
|
||||
export const Button = () => <button>{content}</button>;
|
||||
`,
|
||||
'src/button.test.tsx': `
|
||||
import { test, expect } from '@playwright/experimental-ct-react';
|
||||
|
|
@ -204,8 +208,8 @@ test('should suppport component tests', async ({ runInlineTest, setupRepository,
|
|||
git('commit -am "update button2 test"');
|
||||
|
||||
const result3 = await runInlineTest({
|
||||
'src/button.tsx': `
|
||||
export const Button = () => <button>And another different Button</button>;
|
||||
'src/contents.ts': `
|
||||
export const content = 'Changed Content';
|
||||
`
|
||||
}, { 'workers': 1, 'only-changed': true });
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue