Skip to content

Commit e0d81ee

Browse files
committed
test: fix unstable build --watch test
1 parent be40061 commit e0d81ee

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/integration/cli/build-watch/build.test.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,12 @@ export default defineConfig({
5858
describe('build --watch should handle add / change / unlink', async () => {
5959
test('basic', async () => {
6060
const tempSrcPath = path.join(__dirname, 'test-temp-src');
61+
const tempConfigFile = path.join(__dirname, 'test-temp-rslib.config.mjs');
6162
await fse.remove(tempSrcPath);
6263
await fse.remove(path.join(__dirname, 'dist'));
63-
await fse.copy(path.join(__dirname, 'src'), path.resolve(tempSrcPath));
64-
const tempConfigFile = path.join(__dirname, 'test-temp-rslib.config.mjs');
6564
await fse.remove(tempConfigFile);
65+
66+
await fse.copy(path.join(__dirname, 'src'), path.resolve(tempSrcPath));
6667
fse.outputFileSync(
6768
tempConfigFile,
6869
`import { defineConfig } from '@rslib/core';
@@ -102,11 +103,11 @@ export default defineConfig({
102103
shell: true,
103104
},
104105
);
105-
106106
await awaitFileExists(distIndexFile);
107107

108108
fse.outputFileSync(srcFooFile, `export const foo = 'foo';`);
109109
fse.outputFileSync(srcFoo2File, `export const foo2 = 'foo2';`);
110+
await awaitFileExists(distFooFile);
110111
await awaitFileExists(distFoo2File);
111112
const content1 = await fse.readFile(distFooFile, 'utf-8');
112113
expect(content1!).toMatchInlineSnapshot(`

0 commit comments

Comments
 (0)