@@ -13,7 +13,7 @@ describe('typed-routes-validator', () => {
13
13
it ( 'should generate route validation correctly' , async ( ) => {
14
14
const dts = await next . readFile ( '.next/types/validator.ts' )
15
15
// sanity check that dev generation is working
16
- expect ( dts ) . toContain ( 'handler satisfies AppPageConfig ' )
16
+ expect ( dts ) . toContain ( 'const handler = {} as typeof import( ' )
17
17
} )
18
18
19
19
if ( isNextStart ) {
@@ -51,7 +51,7 @@ describe('typed-routes-validator', () => {
51
51
52
52
expect ( exitCode ) . toBe ( 1 )
53
53
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 < /
55
55
)
56
56
} )
57
57
@@ -111,7 +111,7 @@ describe('typed-routes-validator', () => {
111
111
112
112
expect ( exitCode ) . toBe ( 1 )
113
113
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 < /
115
115
)
116
116
} )
117
117
@@ -132,7 +132,9 @@ describe('typed-routes-validator', () => {
132
132
await next . deleteFile ( 'app/invalid-2/route.ts' )
133
133
134
134
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
+ )
136
138
} )
137
139
138
140
it ( 'should pass type checking with valid layout exports' , async ( ) => {
@@ -174,7 +176,7 @@ describe('typed-routes-validator', () => {
174
176
175
177
expect ( exitCode ) . toBe ( 1 )
176
178
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 < /
178
180
)
179
181
} )
180
182
@@ -220,7 +222,7 @@ describe('typed-routes-validator', () => {
220
222
221
223
expect ( exitCode ) . toBe ( 1 )
222
224
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 ' /
224
226
)
225
227
} )
226
228
}
0 commit comments