@@ -61,24 +61,24 @@ describe('SSR Pages', () => {
61
61
const functionsDir = join ( PROJECT_PATH , 'out_functions' )
62
62
63
63
test ( 'creates a Netlify Function for each SSR page' , ( ) => {
64
- expect ( existsSync ( join ( functionsDir , 'next_index' , 'next_index.js ' ) ) ) . toBe ( true )
65
- expect ( existsSync ( join ( functionsDir , 'next_shows_id' , 'next_shows_id.js ' ) ) ) . toBe ( true )
66
- expect ( existsSync ( join ( functionsDir , 'next_shows_params' , 'next_shows_params.js ' ) ) ) . toBe ( true )
67
- expect ( existsSync ( join ( functionsDir , 'next_getServerSideProps_static' , 'next_getServerSideProps_static.js ' ) ) ) . toBe (
64
+ expect ( existsSync ( join ( functionsDir , 'next_index' , 'next_index.ts ' ) ) ) . toBe ( true )
65
+ expect ( existsSync ( join ( functionsDir , 'next_shows_id' , 'next_shows_id.ts ' ) ) ) . toBe ( true )
66
+ expect ( existsSync ( join ( functionsDir , 'next_shows_params' , 'next_shows_params.ts ' ) ) ) . toBe ( true )
67
+ expect ( existsSync ( join ( functionsDir , 'next_getServerSideProps_static' , 'next_getServerSideProps_static.ts ' ) ) ) . toBe (
68
68
true ,
69
69
)
70
- expect ( existsSync ( join ( functionsDir , 'next_getServerSideProps_id' , 'next_getServerSideProps_id.js ' ) ) ) . toBe ( true )
70
+ expect ( existsSync ( join ( functionsDir , 'next_getServerSideProps_id' , 'next_getServerSideProps_id.ts ' ) ) ) . toBe ( true )
71
71
} )
72
72
} )
73
73
74
74
describe ( 'API Pages' , ( ) => {
75
75
const functionsDir = join ( PROJECT_PATH , 'out_functions' )
76
76
77
77
test ( 'creates a Netlify Function for each API endpoint' , ( ) => {
78
- expect ( existsSync ( join ( functionsDir , 'next_api_static' , 'next_api_static.js ' ) ) ) . toBe ( true )
79
- expect ( existsSync ( join ( functionsDir , 'next_api_shows_id' , 'next_api_shows_id.js ' ) ) ) . toBe ( true )
80
- expect ( existsSync ( join ( functionsDir , 'next_api_shows_params' , 'next_api_shows_params.js ' ) ) ) . toBe ( true )
81
- expect ( existsSync ( join ( functionsDir , 'next_api_hello-background' , 'next_api_hello-background.js ' ) ) ) . toBe ( true )
78
+ expect ( existsSync ( join ( functionsDir , 'next_api_static' , 'next_api_static.ts ' ) ) ) . toBe ( true )
79
+ expect ( existsSync ( join ( functionsDir , 'next_api_shows_id' , 'next_api_shows_id.ts ' ) ) ) . toBe ( true )
80
+ expect ( existsSync ( join ( functionsDir , 'next_api_shows_params' , 'next_api_shows_params.ts ' ) ) ) . toBe ( true )
81
+ expect ( existsSync ( join ( functionsDir , 'next_api_hello-background' , 'next_api_hello-background.ts ' ) ) ) . toBe ( true )
82
82
} )
83
83
} )
84
84
@@ -119,10 +119,10 @@ describe('SSG Pages with getStaticProps', () => {
119
119
} )
120
120
121
121
test ( 'creates Netlify Functions for pages with fallback' , ( ) => {
122
- const functionPath1 = 'next_getStaticProps_withFallback_id/next_getStaticProps_withFallback_id.js '
122
+ const functionPath1 = 'next_getStaticProps_withFallback_id/next_getStaticProps_withFallback_id.ts '
123
123
expect ( existsSync ( join ( PROJECT_PATH , 'out_functions' , functionPath1 ) ) ) . toBe ( true )
124
124
125
- const functionPath2 = 'next_getStaticProps_withFallback_slug/next_getStaticProps_withFallback_slug.js '
125
+ const functionPath2 = 'next_getStaticProps_withFallback_slug/next_getStaticProps_withFallback_slug.ts '
126
126
expect ( existsSync ( join ( PROJECT_PATH , 'out_functions' , functionPath2 ) ) ) . toBe ( true )
127
127
} )
128
128
} )
@@ -132,19 +132,19 @@ describe('SSG Pages with getStaticProps and revalidate', () => {
132
132
133
133
test ( 'creates a Netlify Function for each page' , ( ) => {
134
134
expect (
135
- existsSync ( join ( functionsDir , 'next_getStaticProps_withrevalidate' , 'next_getStaticProps_withrevalidate.js ' ) ) ,
135
+ existsSync ( join ( functionsDir , 'next_getStaticProps_withrevalidate' , 'next_getStaticProps_withrevalidate.ts ' ) ) ,
136
136
) . toBe ( true )
137
137
expect (
138
138
existsSync (
139
- join ( functionsDir , 'next_getStaticProps_withRevalidate_id' , 'next_getStaticProps_withRevalidate_id.js ' ) ,
139
+ join ( functionsDir , 'next_getStaticProps_withRevalidate_id' , 'next_getStaticProps_withRevalidate_id.ts ' ) ,
140
140
) ,
141
141
) . toBe ( true )
142
142
expect (
143
143
existsSync (
144
144
join (
145
145
functionsDir ,
146
146
'next_getStaticProps_withRevalidate_withFallback_id' ,
147
- 'next_getStaticProps_withRevalidate_withFallback_id.js ' ,
147
+ 'next_getStaticProps_withRevalidate_withFallback_id.ts ' ,
148
148
) ,
149
149
) ,
150
150
) . toBe ( true )
0 commit comments