Skip to content

Commit 053405a

Browse files
authored
test: rename rsbuildConfig to config in test files (#6246)
1 parent ea05b11 commit 053405a

File tree

173 files changed

+553
-948
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

173 files changed

+553
-948
lines changed

e2e/cases/assets/addtional-assets/index.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ test('should support configuring additional assets matched by RegExp', async ({
99
build,
1010
}) => {
1111
const rsbuild = await build({
12-
rsbuildConfig: {
12+
config: {
1313
source: {
1414
assetsInclude: [/\.json5$/],
1515
},
@@ -34,7 +34,7 @@ test('should support configuring additional assets matched by path', async ({
3434
build,
3535
}) => {
3636
const rsbuild = await build({
37-
rsbuildConfig: {
37+
config: {
3838
source: {
3939
assetsInclude: path.resolve(__dirname, 'src/assets'),
4040
},
@@ -59,7 +59,7 @@ test('should support disabling emission for additional assets', async ({
5959
build,
6060
}) => {
6161
const rsbuild = await build({
62-
rsbuildConfig: {
62+
config: {
6363
source: {
6464
assetsInclude: [/\.json5$/],
6565
},

e2e/cases/assets/asset-prefix/index.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { expect, test } from '@e2e/helper';
22

33
test('should allow dev.assetPrefix to be `auto`', async ({ page, dev }) => {
44
await dev({
5-
rsbuildConfig: {
5+
config: {
66
dev: {
77
assetPrefix: 'auto',
88
},
@@ -18,7 +18,7 @@ test('should allow dev.assetPrefix to be `auto`', async ({ page, dev }) => {
1818

1919
test('should allow dev.assetPrefix to be true', async ({ page, dev }) => {
2020
const result = await dev({
21-
rsbuildConfig: {
21+
config: {
2222
dev: {
2323
assetPrefix: true,
2424
},
@@ -34,7 +34,7 @@ test('should allow dev.assetPrefix to have <port> placeholder', async ({
3434
dev,
3535
}) => {
3636
const result = await dev({
37-
rsbuildConfig: {
37+
config: {
3838
dev: {
3939
assetPrefix: 'http://localhost:<port>/',
4040
},
@@ -53,7 +53,7 @@ test('should allow output.assetPrefix to be `auto`', async ({
5353
buildPreview,
5454
}) => {
5555
await buildPreview({
56-
rsbuildConfig: {
56+
config: {
5757
output: {
5858
assetPrefix: 'auto',
5959
},
@@ -69,7 +69,7 @@ test('should inject assetPrefix to env var and template correctly', async ({
6969
buildPreview,
7070
}) => {
7171
await buildPreview({
72-
rsbuildConfig: {
72+
config: {
7373
html: {
7474
template: './src/template.html',
7575
},
@@ -86,7 +86,7 @@ test('should inject assetPrefix to env var and template correctly', async ({
8686

8787
test('should use output.assetPrefix in none mode', async ({ build }) => {
8888
const result = await build({
89-
rsbuildConfig: {
89+
config: {
9090
mode: 'none',
9191
dev: {
9292
assetPrefix: 'http://dev.com',

e2e/cases/assets/raw-query/index.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ test('should return raw SVG content with `?raw` when using pluginSvgr', async ({
3737
dev,
3838
}) => {
3939
await dev({
40-
rsbuildConfig: {
40+
config: {
4141
plugins: [pluginSvgr()],
4242
},
4343
});
@@ -76,7 +76,7 @@ test('should return raw TSX content with `?raw` when using pluginReact', async (
7676
dev,
7777
}) => {
7878
await dev({
79-
rsbuildConfig: {
79+
config: {
8080
plugins: [pluginReact()],
8181
},
8282
});

e2e/cases/cache/build-dependencies/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ test('should respect `buildCache.buildDependencies`', async ({ build }) => {
1818
const getBuildConfig = (input: string) => {
1919
fs.writeFileSync(testDepsPath, input);
2020
return {
21-
rsbuildConfig: {
21+
config: {
2222
tools: {
2323
bundlerChain: (chain) => {
2424
if (input === 'foo') {

e2e/cases/cache/cache-digest/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ test('should respect `buildCache.cacheDigest`', async ({ build }) => {
1313
await remove(cacheDirectory);
1414

1515
const getBuildConfig = (input: string) => ({
16-
rsbuildConfig: {
16+
config: {
1717
tools: {
1818
bundlerChain: (chain) => {
1919
if (input === 'foo') {

e2e/cases/cache/cache-directory/index.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ test('should use `buildCache.cacheDirectory` as expected in dev', async ({
1212
await remove(cacheDirectory);
1313

1414
await dev({
15-
rsbuildConfig: {
15+
config: {
1616
performance: {
1717
buildCache: {
1818
cacheDirectory,
@@ -34,7 +34,7 @@ test('should use `buildCache.cacheDirectory` as expected in build', async ({
3434
await remove(cacheDirectory);
3535

3636
await build({
37-
rsbuildConfig: {
37+
config: {
3838
performance: {
3939
buildCache: {
4040
cacheDirectory,

e2e/cases/cli/inspect/index.test.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,11 @@ rspackTest('should run inspect command correctly', async ({ execCliSync }) => {
1414
const files = await readDirContents(path.join(__dirname, 'dist/.rsbuild'));
1515
const fileNames = Object.keys(files);
1616

17-
const rsbuildConfig = fileNames.find((item) =>
18-
item.includes('rsbuild.config.mjs'),
19-
);
20-
expect(rsbuildConfig).toBeTruthy();
21-
expect(files[rsbuildConfig!]).toContain("'rsbuild:basic'");
22-
expect(files[rsbuildConfig!]).toContain('hmr: true');
23-
expect(files[rsbuildConfig!]).toContain('plugins:');
17+
const config = fileNames.find((item) => item.includes('rsbuild.config.mjs'));
18+
expect(config).toBeTruthy();
19+
expect(files[config!]).toContain("'rsbuild:basic'");
20+
expect(files[config!]).toContain('hmr: true');
21+
expect(files[config!]).toContain('plugins:');
2422

2523
const rspackConfig = fileNames.find((item) =>
2624
item.includes('rspack.config.web.mjs'),
@@ -39,10 +37,10 @@ rspackTest(
3937
const files = await readDirContents(path.join(__dirname, 'dist/.rsbuild'));
4038
const fileNames = Object.keys(files);
4139

42-
const rsbuildConfig = fileNames.find((item) =>
40+
const config = fileNames.find((item) =>
4341
item.includes('rsbuild.config.mjs'),
4442
);
45-
expect(rsbuildConfig).toBeTruthy();
43+
expect(config).toBeTruthy();
4644

4745
const rspackConfig = fileNames.find((item) =>
4846
item.includes('rspack.config.web.mjs'),

e2e/cases/cli/shortcuts/dev.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
1010
async function main() {
1111
const rsbuild = await createRsbuild({
1212
cwd: __dirname,
13-
rsbuildConfig: {
13+
config: {
1414
dev: {
1515
cliShortcuts: true,
1616
},

e2e/cases/cli/shortcuts/devCustom.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
1010
async function main() {
1111
const rsbuild = await createRsbuild({
1212
cwd: __dirname,
13-
rsbuildConfig: {
13+
config: {
1414
dev: {
1515
cliShortcuts: {
1616
custom: (shortcuts) => {

e2e/cases/cli/shortcuts/preview.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
1010
async function main() {
1111
const rsbuild = await createRsbuild({
1212
cwd: __dirname,
13-
rsbuildConfig: {
13+
config: {
1414
dev: {
1515
cliShortcuts: true,
1616
},

0 commit comments

Comments
 (0)