Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 56029d2

Browse files
mrstorkserhalp
andauthored
test: add await to rejects.toThrowError statements (#3046)
Co-authored-by: Philippe Serhal <philippe.serhal@netlify.com>
1 parent f5ff672 commit 56029d2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎tests/integration/simple-app.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,21 +149,21 @@ test<FixtureTestContext>('Test that the simple next app is working', async (ctx)
149149
describe('verification', () => {
150150
test<FixtureTestContext>("Should warn if publish dir doesn't exist", async (ctx) => {
151151
await createFixture('simple', ctx)
152-
expect(() => runPlugin(ctx, { PUBLISH_DIR: 'no-such-directory' })).rejects.toThrowError(
152+
awaitexpect(() => runPlugin(ctx, { PUBLISH_DIR: 'no-such-directory' })).rejects.toThrowError(
153153
/Yourpublishdirectorywasnotfoundat:\S+no-such-directory.Pleasecheckyourbuildsettings/,
154154
)
155155
})
156156

157157
test<FixtureTestContext>('Should warn if publish dir is root', async (ctx) => {
158158
await createFixture('simple', ctx)
159-
expect(() => runPlugin(ctx, { PUBLISH_DIR: '.' })).rejects.toThrowError(
159+
awaitexpect(() => runPlugin(ctx, { PUBLISH_DIR: '.' })).rejects.toThrowError(
160160
'Your publish directory cannot be the same as the base directory of your site. Please check your build settings',
161161
)
162162
})
163163

164164
test<FixtureTestContext>('Should warn if publish dir is root (package path variant)', async (ctx) => {
165165
await createFixture('simple', ctx)
166-
expect(() =>
166+
awaitexpect(() =>
167167
runPlugin(ctx, { PUBLISH_DIR: 'app/.', PACKAGE_PATH: 'app' }),
168168
).rejects.toThrowError(
169169
'Your publish directory cannot be the same as the base directory of your site. Please check your build settings',
@@ -172,7 +172,7 @@ describe('verification', () => {
172172

173173
test<FixtureTestContext>('Should warn if publish dir is not set to Next.js output directory', async (ctx) => {
174174
await createFixture('simple', ctx)
175-
expect(() => runPlugin(ctx, { PUBLISH_DIR: 'public' })).rejects.toThrowError(
175+
awaitexpect(() => runPlugin(ctx, { PUBLISH_DIR: 'public' })).rejects.toThrowError(
176176
'Your publish directory does not contain expected Next.js build output. Please check your build settings',
177177
)
178178
})

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /