Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import fs from 'node:fs';
import path from 'node:path';
import { build, dev, gotoPage } from '@e2e/helper';
import { build, dev } from '@e2e/helper';
import { expect, test } from '@playwright/test';
import { logger } from '@rsbuild/core';

Expand All @@ -13,7 +13,7 @@ const getBundlerConfig = (dist: string) =>
`./${dist}/.rsbuild/${process.env.PROVIDE_TYPE || 'rspack'}.config.web.mjs`,
);

test('should generate config files when build (with DEBUG)', async () => {
test('should generate config files in debug mode when build', async () => {
const { level } = logger;
logger.level = 'verbose';
process.env.DEBUG = 'rsbuild';
Expand All @@ -26,7 +26,6 @@ test('should generate config files when build (with DEBUG)', async () => {
distPath: {
root: distRoot,
},
cleanDistPath: true,
},
},
});
Expand All @@ -45,7 +44,9 @@ test('should generate config files when build (with DEBUG)', async () => {
await close();
});

test('should generate config files when dev (with DEBUG)', async ({ page }) => {
test('should generate config files in debug mode when dev', async ({
page,
}) => {
const { level } = logger;
process.env.DEBUG = 'rsbuild';
logger.level = 'verbose';
Expand All @@ -58,15 +59,11 @@ test('should generate config files when dev (with DEBUG)', async ({ page }) => {
distPath: {
root: distRoot,
},
cleanDistPath: true,
},
},
page,
});

const res = await gotoPage(page, rsbuild);

expect(res?.status()).toBe(200);

expect(fs.existsSync(getRsbuildConfig(distRoot))).toBeTruthy();
expect(fs.existsSync(getBundlerConfig(distRoot))).toBeTruthy();

Expand Down
1 change: 1 addition & 0 deletions e2e/cases/config/debug-mode/src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// empty
Loading