@@ -13,7 +13,7 @@ describe('typed-routes-validator', () => {
1313 it ( 'should generate route validation correctly' , async ( ) => {
1414 const dts = await next . readFile ( '.next/types/validator.ts' )
1515 // sanity check that dev generation is working
16- expect ( dts ) . toContain ( 'handler satisfies AppPageConfig ' )
16+ expect ( dts ) . toContain ( 'const handler = {} as typeof import( ' )
1717 } )
1818
1919 if ( isNextStart ) {
@@ -51,7 +51,7 @@ describe('typed-routes-validator', () => {
5151
5252 expect ( exitCode ) . toBe ( 1 )
5353 expect ( cliOutput ) . toMatch (
54- / T y p e e r r o r : T y p e ' t y p e o f i m p o r t \( .* \) ' d o e s n o t s a t i s f y t h e e x p e c t e d t y p e ' A p p P a g e C o n f i g < " \/ i n v a l i d " > ' /
54+ / T y p e e r r o r : T y p e ' t y p e o f i m p o r t \( .* ' d o e s n o t s a t i s f y t h e c o n s t r a i n t ' A p p P a g e C o n f i g < /
5555 )
5656 } )
5757
@@ -111,7 +111,7 @@ describe('typed-routes-validator', () => {
111111
112112 expect ( exitCode ) . toBe ( 1 )
113113 expect ( cliOutput ) . toMatch (
114- / T y p e e r r o r : T y p e ' t y p e o f i m p o r t . * d o e s n o t s a t i s f y t h e e x p e c t e d t y p e ' R o u t e H a n d l e r C o n f i g < " \/ i n v a l i d " > ' /
114+ / T y p e e r r o r : T y p e ' t y p e o f i m p o r t \( . * ' d o e s n o t s a t i s f y t h e c o n s t r a i n t ' R o u t e H a n d l e r C o n f i g < /
115115 )
116116 } )
117117
@@ -132,7 +132,9 @@ describe('typed-routes-validator', () => {
132132 await next . deleteFile ( 'app/invalid-2/route.ts' )
133133
134134 expect ( exitCode ) . toBe ( 1 )
135- expect ( cliOutput ) . toContain ( `Types of property 'POST' are incompatible.` )
135+ expect ( cliOutput ) . toMatch (
136+ / T y p e e r r o r : T y p e ' t y p e o f i m p o r t \( .* ' d o e s n o t s a t i s f y t h e c o n s t r a i n t ' R o u t e H a n d l e r C o n f i g < /
137+ )
136138 } )
137139
138140 it ( 'should pass type checking with valid layout exports' , async ( ) => {
@@ -174,7 +176,7 @@ describe('typed-routes-validator', () => {
174176
175177 expect ( exitCode ) . toBe ( 1 )
176178 expect ( cliOutput ) . toMatch (
177- / T y p e e r r o r : T y p e ' t y p e o f i m p o r t \( .* d o e s n o t s a t i s f y t h e e x p e c t e d t y p e ' L a y o u t C o n f i g < " \/ i n v a l i d " > ' /
179+ / T y p e e r r o r : T y p e ' t y p e o f i m p o r t \( .* ' d o e s n o t s a t i s f y t h e c o n s t r a i n t ' L a y o u t C o n f i g < /
178180 )
179181 } )
180182
@@ -220,7 +222,7 @@ describe('typed-routes-validator', () => {
220222
221223 expect ( exitCode ) . toBe ( 1 )
222224 expect ( cliOutput ) . toMatch (
223- / T y p e e r r o r : T y p e ' t y p e o f i m p o r t \( .* d o e s n o t s a t i s f y t h e e x p e c t e d t y p e ' A p i R o u t e C o n f i g ' /
225+ / T y p e e r r o r : T y p e ' t y p e o f i m p o r t \( .* ' d o e s n o t s a t i s f y t h e c o n s t r a i n t ' A p i R o u t e C o n f i g ' /
224226 )
225227 } )
226228 }
0 commit comments