Skip to content

Commit cef5a6a

Browse files
authored
test: replace onDevCompileDone with onAfterDevCompile (#1393)
1 parent e6282bf commit cef5a6a

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

tests/integration/plugins/mf-dev/rslib.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const plugin2Path = path.resolve(__dirname, 'dist/mf/plugin2.txt');
1111
const testPlugin1: RsbuildPlugin = {
1212
name: 'test1',
1313
setup(api) {
14-
api.onDevCompileDone(() => {
14+
api.onAfterDevCompile(() => {
1515
fs.writeFileSync(plugin1Path, `plugin1 count: ${++count}`);
1616
});
1717
},
@@ -20,7 +20,7 @@ const testPlugin1: RsbuildPlugin = {
2020
const testPlugin2: RsbuildPlugin = {
2121
name: 'test2',
2222
setup(api) {
23-
api.onDevCompileDone(() => {
23+
api.onAfterDevCompile(() => {
2424
fs.writeFileSync(plugin2Path, 'plugin2');
2525
});
2626
},

tests/integration/server/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ describe('server config', async () => {
3434
await expectFile(doneFile);
3535

3636
const rsbuildConfigContent = await fse.readFile(rsbuildConfigFile, 'utf-8');
37-
expect(rsbuildConfigContent).toContain('open: true');
37+
expect(rsbuildConfigContent).toContain('open: false');
3838
expect(rsbuildConfigContent).toContain('port: 3011');
3939

4040
childProcess.kill();

tests/integration/server/mf-dev/rslib.config.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ import { generateBundleMFConfig } from 'test-helper';
66

77
const distPath = join(__dirname, 'dist/mf');
88

9-
const afterDevCompileDonePlugin: RsbuildPlugin = {
9+
const afterDevCompilePlugin: RsbuildPlugin = {
1010
name: 'dev-done',
1111
setup(api) {
12-
api.onDevCompileDone(() => {
12+
api.onAfterDevCompile(() => {
1313
fs.writeFileSync(join(distPath, 'done.txt'), 'done');
1414
});
1515
},
@@ -19,7 +19,7 @@ export default defineConfig({
1919
lib: [generateBundleMFConfig({ name: 'test' })],
2020
server: {
2121
port: 3011,
22-
open: true,
22+
open: false,
2323
},
24-
plugins: [afterDevCompileDonePlugin],
24+
plugins: [afterDevCompilePlugin],
2525
});

0 commit comments

Comments
 (0)