@@ -26,7 +26,7 @@ describe("getNextPagesFromBuildDir", () => {
26
26
it ( "should return an empty array when there are no pages" , ( ) => {
27
27
expect . assertions ( 1 ) ;
28
28
29
- const buildDir = path . normalize ( "/ path/to/build/dir " ) ;
29
+ const buildDir = path . normalize ( "path/to/sls-next- build" ) ;
30
30
31
31
const getPagesPromise = getNextPagesFromBuildDir ( buildDir ) . then (
32
32
nextPages => {
@@ -42,15 +42,15 @@ describe("getNextPagesFromBuildDir", () => {
42
42
it ( "should return two next pages" , ( ) => {
43
43
expect . assertions ( 5 ) ;
44
44
45
- const buildDir = "build" ;
45
+ const buildDir = "sls-next- build" ;
46
46
const resolvedBuildDir = path . resolve ( buildDir ) ;
47
47
48
48
const promise = getNextPagesFromBuildDir ( buildDir ) . then ( nextPages => {
49
49
expect ( nextPages ) . toHaveLength ( 2 ) ;
50
50
expect ( nextPages [ 0 ] . pageName ) . toEqual ( "index" ) ;
51
- expect ( nextPages [ 0 ] . pagePath ) . toEqual ( path . join ( "build" , "index.js" ) ) ;
51
+ expect ( nextPages [ 0 ] . pagePath ) . toEqual ( path . join ( buildDir , "index.js" ) ) ;
52
52
expect ( nextPages [ 1 ] . pageName ) . toEqual ( "about" ) ;
53
- expect ( nextPages [ 1 ] . pagePath ) . toEqual ( path . join ( "build" , "about.js" ) ) ;
53
+ expect ( nextPages [ 1 ] . pagePath ) . toEqual ( path . join ( buildDir , "about.js" ) ) ;
54
54
} ) ;
55
55
56
56
mockedStream . emit ( "data" , {
@@ -75,7 +75,7 @@ describe("getNextPagesFromBuildDir", () => {
75
75
about : aboutPageConfigOverride
76
76
} ;
77
77
78
- const buildDir = path . normalize ( "/path/to/build" ) ;
78
+ const buildDir = path . normalize ( "/path/to/sls-next- build" ) ;
79
79
80
80
const promise = getNextPagesFromBuildDir ( buildDir , pageConfig ) . then (
81
81
nextPages => {
@@ -113,7 +113,7 @@ describe("getNextPagesFromBuildDir", () => {
113
113
it ( "should skip _app and _document pages" , ( ) => {
114
114
expect . assertions ( 2 ) ;
115
115
116
- const buildDir = path . normalize ( "./build" ) ;
116
+ const buildDir = path . normalize ( "./sls-next- build" ) ;
117
117
const resolvedBuildDir = path . resolve ( buildDir ) ;
118
118
119
119
const promise = getNextPagesFromBuildDir ( buildDir ) . then ( nextPages => {
@@ -136,7 +136,7 @@ describe("getNextPagesFromBuildDir", () => {
136
136
it ( "should skip compatLayer file" , ( ) => {
137
137
expect . assertions ( 2 ) ;
138
138
139
- const buildDir = path . normalize ( "/path/to/build" ) ;
139
+ const buildDir = path . normalize ( "/path/to/sls-next- build" ) ;
140
140
141
141
const promise = getNextPagesFromBuildDir ( buildDir ) . then ( nextPages => {
142
142
expect ( nextPages ) . toHaveLength ( 1 ) ;
@@ -153,7 +153,7 @@ describe("getNextPagesFromBuildDir", () => {
153
153
it ( "should handle nested pages" , ( ) => {
154
154
expect . assertions ( 5 ) ;
155
155
156
- const buildDir = path . normalize ( "./build" ) ;
156
+ const buildDir = path . normalize ( "./sls-next- build" ) ;
157
157
const resolvedBuildDir = path . resolve ( buildDir ) ;
158
158
159
159
const promise = getNextPagesFromBuildDir ( buildDir ) . then ( nextPages => {
@@ -182,7 +182,7 @@ describe("getNextPagesFromBuildDir", () => {
182
182
it ( "should skip page directories" , ( ) => {
183
183
expect . assertions ( 1 ) ;
184
184
185
- const buildDir = path . normalize ( "./build" ) ;
185
+ const buildDir = path . normalize ( "./sls-next- build" ) ;
186
186
const resolvedBuildDir = path . resolve ( buildDir ) ;
187
187
fs . lstatSync . mockReturnValue ( { isDirectory : ( ) => true } ) ;
188
188
0 commit comments