Skip to content

Commit

Permalink
test: Correct some tests not awaiting build completion to pass
Browse files Browse the repository at this point in the history
  • Loading branch information
rschristian committed Apr 15, 2022
1 parent 57fc6c4 commit 96df7de
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/cli/tests/build.test.js
Expand Up @@ -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 () => {
Expand Down Expand Up @@ -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();
});

Expand Down

0 comments on commit 96df7de

Please sign in to comment.