From 96df7deecf69bcd90b39c03c54347be32f565f2a Mon Sep 17 00:00:00 2001 From: Ryan Christian Date: Thu, 14 Apr 2022 19:08:07 -0500 Subject: [PATCH] test: Correct some tests not awaiting build completion to pass --- packages/cli/tests/build.test.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/cli/tests/build.test.js b/packages/cli/tests/build.test.js index 6a3e5bcaf..a2be5370b 100644 --- a/packages/cli/tests/build.test.js +++ b/packages/cli/tests/build.test.js @@ -90,13 +90,13 @@ describe('preact build', () => { // Remove when https://github.com/preactjs/enzyme-adapter-preact-pure/issues/161 is resolved shell.exec('rm tsconfig.json'); - expect(() => build(dir)).not.toThrow(); + await expect(build(dir)).resolves.not.toThrow(); }); it('should patch global location object', async () => { let dir = await subject('location-patch'); - expect(() => build(dir)).not.toThrow(); + await expect(build(dir)).resolves.not.toThrow(); }); it('should copy resources from static to build directory', async () => { @@ -349,9 +349,9 @@ describe('preact build', () => { await rename( join(dir, 'preact.config.js'), - join(dir, 'preact-config.js') + join(dir, 'renamed-config.js') ); - await build(dir, { config: 'preact-config.js' }); + await build(dir, { config: 'renamed-config.js' }); expect(await access(join(dir, 'build/bundle.js'))).toBeUndefined(); });