(originalConfig: RsbuildConfig, cwd: string = process.cwd())
| 14 | import { getRandomPort, gotoPage, noop, toPosixPath } from './utils.ts'; |
| 15 | |
| 16 | const updateConfigForTest = async (originalConfig: RsbuildConfig, cwd: string = process.cwd()) => { |
| 17 | const { loadConfig, mergeRsbuildConfig } = await import('@rsbuild/core'); |
| 18 | const { content: loadedConfig } = await loadConfig({ |
| 19 | cwd, |
| 20 | }); |
| 21 | |
| 22 | const baseConfig: RsbuildConfig = { |
| 23 | server: { |
| 24 | // make port random to avoid conflict |
| 25 | port: await getRandomPort(), |
| 26 | }, |
| 27 | performance: { |
| 28 | buildCache: false, |
| 29 | }, |
| 30 | }; |
| 31 | |
| 32 | const mergedConfig = mergeRsbuildConfig(baseConfig, loadedConfig, originalConfig); |
| 33 | |
| 34 | return mergedConfig; |
| 35 | }; |
| 36 | |
| 37 | const filterSourceMaps = (distFiles: Record<string, string>) => { |
| 38 | return Object.entries(distFiles).reduce( |
no test coverage detected
searching dependent graphs…