@@ -14,19 +14,29 @@ beforeEach<FixtureTestContext>(async (ctx) => {
14
14
vi . stubEnv ( 'SITE_ID' , ctx . siteID )
15
15
vi . stubEnv ( 'DEPLOY_ID' , ctx . deployID )
16
16
vi . stubEnv ( 'NETLIFY_PURGE_API_TOKEN' , 'fake-token' )
17
- // hide debug logs in tests
18
- // vi.spyOn(console, 'debug').mockImplementation(() => {})
17
+ vi . resetModules ( )
19
18
20
19
await startMockBlobStore ( ctx )
21
20
} )
22
21
23
- // test skipped until we actually start failing builds - right now we are just showing a warning
24
- it . skip < FixtureTestContext > ( 'should fail build when netlify forms are used' , async ( ctx ) => {
22
+ it < FixtureTestContext > ( 'should warn when netlify forms are used' , async ( ctx ) => {
23
+ const warn = vi . spyOn ( console , 'warn' ) . mockImplementation ( ( ) => { } )
24
+
25
25
await createFixture ( 'netlify-forms' , ctx )
26
26
27
- const runPluginPromise = runPlugin ( ctx )
27
+ const runPluginPromise = await runPlugin ( ctx )
28
28
29
- await expect ( runPluginPromise ) . rejects . toThrow (
30
- '@netlify/plugin-next@5 does not support Netlify Forms' ,
29
+ expect ( warn ) . toBeCalledWith (
30
+ '@netlify/plugin-next@5 does not support Netlify Forms. Refer to https://ntl.fyi/next-runtime-forms-migration for migration example. ' ,
31
31
)
32
32
} )
33
+
34
+ it < FixtureTestContext > ( 'should not warn when netlify forms are used with workaround' , async ( ctx ) => {
35
+ const warn = vi . spyOn ( console , 'warn' ) . mockImplementation ( ( ) => { } )
36
+
37
+ await createFixture ( 'netlify-forms-workaround' , ctx )
38
+
39
+ const runPluginPromise = await runPlugin ( ctx )
40
+
41
+ expect ( warn ) . not . toBeCalled ( )
42
+ } )
0 commit comments