Skip to content

Commit 82b273f

Browse files
committed
test: await rejects.toThrowError in tests
1 parent e37a5e0 commit 82b273f

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+
await expect(() => runPlugin(ctx, { PUBLISH_DIR: 'no-such-directory' })).rejects.toThrowError(
153153
/Your publish directory was not found at: \S+no-such-directory. Please check your build settings/,
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+
await expect(() => 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+
await expect(() =>
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+
await expect(() => 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)