Skip to content

Commit 8e0a3f0

Browse files
committed
test: update forms tests
1 parent c6d5b79 commit 8e0a3f0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tests/integration/netlify-forms.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,24 @@ beforeEach<FixtureTestContext>(async (ctx) => {
1919
await startMockBlobStore(ctx)
2020
})
2121

22-
it<FixtureTestContext>('should warn when netlify forms are used', async (ctx) => {
22+
it<FixtureTestContext>('should fail build when netlify forms are used', async (ctx) => {
2323
const warn = vi.spyOn(console, 'warn').mockImplementation(() => {})
2424

2525
await createFixture('netlify-forms', ctx)
2626

27-
const runPluginPromise = await runPlugin(ctx)
27+
const runPluginPromise = runPlugin(ctx)
2828

29-
expect(warn).toBeCalledWith(
29+
await expect(runPluginPromise).rejects.toThrow(
3030
'@netlify/plugin-nextjs@5 requires migration steps to support Netlify Forms. Refer to https://ntl.fyi/next-runtime-forms-migration for migration example.',
3131
)
3232
})
3333

34-
it<FixtureTestContext>('should not warn when netlify forms are used with workaround', async (ctx) => {
34+
it<FixtureTestContext>('should not fail build when netlify forms are used with workaround', async (ctx) => {
3535
const warn = vi.spyOn(console, 'warn').mockImplementation(() => {})
3636

3737
await createFixture('netlify-forms-workaround', ctx)
3838

39-
const runPluginPromise = await runPlugin(ctx)
39+
const runPluginPromise = runPlugin(ctx)
4040

41-
expect(warn).not.toBeCalled()
41+
await expect(runPluginPromise).resolves
4242
})

0 commit comments

Comments
 (0)