@@ -61,27 +61,27 @@ 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 )
71
70
expect (
72
71
readFileSync ( join ( functionsDir , 'next_getServerSideProps_id' , 'nextPage' , 'index.js' ) , 'utf-8' ) ,
73
72
) . toBe ( `module.exports = require("./pages/getServerSideProps/[id].js")` )
73
+ expect ( existsSync ( join ( functionsDir , 'next_getServerSideProps_id' , 'next_getServerSideProps_id.ts' ) ) ) . toBe ( true )
74
74
} )
75
75
} )
76
76
77
77
describe ( 'API Pages' , ( ) => {
78
78
const functionsDir = join ( PROJECT_PATH , 'out_functions' )
79
79
80
80
test ( 'creates a Netlify Function for each API endpoint' , ( ) => {
81
- expect ( existsSync ( join ( functionsDir , 'next_api_static' , 'next_api_static.js ' ) ) ) . toBe ( true )
82
- expect ( existsSync ( join ( functionsDir , 'next_api_shows_id' , 'next_api_shows_id.js ' ) ) ) . toBe ( true )
83
- expect ( existsSync ( join ( functionsDir , 'next_api_shows_params' , 'next_api_shows_params.js ' ) ) ) . toBe ( true )
84
- expect ( existsSync ( join ( functionsDir , 'next_api_hello-background' , 'next_api_hello-background.js ' ) ) ) . toBe ( true )
81
+ expect ( existsSync ( join ( functionsDir , 'next_api_static' , 'next_api_static.ts ' ) ) ) . toBe ( true )
82
+ expect ( existsSync ( join ( functionsDir , 'next_api_shows_id' , 'next_api_shows_id.ts ' ) ) ) . toBe ( true )
83
+ expect ( existsSync ( join ( functionsDir , 'next_api_shows_params' , 'next_api_shows_params.ts ' ) ) ) . toBe ( true )
84
+ expect ( existsSync ( join ( functionsDir , 'next_api_hello-background' , 'next_api_hello-background.ts ' ) ) ) . toBe ( true )
85
85
} )
86
86
} )
87
87
@@ -127,10 +127,10 @@ describe('SSG Pages with getStaticProps', () => {
127
127
} )
128
128
129
129
test ( 'creates Netlify Functions for pages with fallback' , ( ) => {
130
- const functionPath1 = 'next_getStaticProps_withFallback_id/next_getStaticProps_withFallback_id.js '
130
+ const functionPath1 = 'next_getStaticProps_withFallback_id/next_getStaticProps_withFallback_id.ts '
131
131
expect ( existsSync ( join ( PROJECT_PATH , 'out_functions' , functionPath1 ) ) ) . toBe ( true )
132
132
133
- const functionPath2 = 'next_getStaticProps_withFallback_slug/next_getStaticProps_withFallback_slug.js '
133
+ const functionPath2 = 'next_getStaticProps_withFallback_slug/next_getStaticProps_withFallback_slug.ts '
134
134
expect ( existsSync ( join ( PROJECT_PATH , 'out_functions' , functionPath2 ) ) ) . toBe ( true )
135
135
} )
136
136
} )
@@ -140,19 +140,19 @@ describe('SSG Pages with getStaticProps and revalidate', () => {
140
140
141
141
test ( 'creates a Netlify Function for each page' , ( ) => {
142
142
expect (
143
- existsSync ( join ( functionsDir , 'next_getStaticProps_withrevalidate' , 'next_getStaticProps_withrevalidate.js ' ) ) ,
143
+ existsSync ( join ( functionsDir , 'next_getStaticProps_withrevalidate' , 'next_getStaticProps_withrevalidate.ts ' ) ) ,
144
144
) . toBe ( true )
145
145
expect (
146
146
existsSync (
147
- join ( functionsDir , 'next_getStaticProps_withRevalidate_id' , 'next_getStaticProps_withRevalidate_id.js ' ) ,
147
+ join ( functionsDir , 'next_getStaticProps_withRevalidate_id' , 'next_getStaticProps_withRevalidate_id.ts ' ) ,
148
148
) ,
149
149
) . toBe ( true )
150
150
expect (
151
151
existsSync (
152
152
join (
153
153
functionsDir ,
154
154
'next_getStaticProps_withRevalidate_withFallback_id' ,
155
- 'next_getStaticProps_withRevalidate_withFallback_id.js ' ,
155
+ 'next_getStaticProps_withRevalidate_withFallback_id.ts ' ,
156
156
) ,
157
157
) ,
158
158
) . toBe ( true )
0 commit comments