Skip to content
This repository was archived by the owner on Jan 28, 2025. It is now read-only.

Commit d55f762

Browse files
author
Daniel Conde
committed
test: use sls-next-build for buildDir test variable
1 parent f1b30cb commit d55f762

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

lib/__tests__/getNextPagesFromBuildDir.test.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ describe("getNextPagesFromBuildDir", () => {
2626
it("should return an empty array when there are no pages", () => {
2727
expect.assertions(1);
2828

29-
const buildDir = path.normalize("/path/to/build/dir");
29+
const buildDir = path.normalize("path/to/sls-next-build");
3030

3131
const getPagesPromise = getNextPagesFromBuildDir(buildDir).then(
3232
nextPages => {
@@ -42,15 +42,15 @@ describe("getNextPagesFromBuildDir", () => {
4242
it("should return two next pages", () => {
4343
expect.assertions(5);
4444

45-
const buildDir = "build";
45+
const buildDir = "sls-next-build";
4646
const resolvedBuildDir = path.resolve(buildDir);
4747

4848
const promise = getNextPagesFromBuildDir(buildDir).then(nextPages => {
4949
expect(nextPages).toHaveLength(2);
5050
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"));
5252
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"));
5454
});
5555

5656
mockedStream.emit("data", {
@@ -75,7 +75,7 @@ describe("getNextPagesFromBuildDir", () => {
7575
about: aboutPageConfigOverride
7676
};
7777

78-
const buildDir = path.normalize("/path/to/build");
78+
const buildDir = path.normalize("/path/to/sls-next-build");
7979

8080
const promise = getNextPagesFromBuildDir(buildDir, pageConfig).then(
8181
nextPages => {
@@ -113,7 +113,7 @@ describe("getNextPagesFromBuildDir", () => {
113113
it("should skip _app and _document pages", () => {
114114
expect.assertions(2);
115115

116-
const buildDir = path.normalize("./build");
116+
const buildDir = path.normalize("./sls-next-build");
117117
const resolvedBuildDir = path.resolve(buildDir);
118118

119119
const promise = getNextPagesFromBuildDir(buildDir).then(nextPages => {
@@ -136,7 +136,7 @@ describe("getNextPagesFromBuildDir", () => {
136136
it("should skip compatLayer file", () => {
137137
expect.assertions(2);
138138

139-
const buildDir = path.normalize("/path/to/build");
139+
const buildDir = path.normalize("/path/to/sls-next-build");
140140

141141
const promise = getNextPagesFromBuildDir(buildDir).then(nextPages => {
142142
expect(nextPages).toHaveLength(1);
@@ -153,7 +153,7 @@ describe("getNextPagesFromBuildDir", () => {
153153
it("should handle nested pages", () => {
154154
expect.assertions(5);
155155

156-
const buildDir = path.normalize("./build");
156+
const buildDir = path.normalize("./sls-next-build");
157157
const resolvedBuildDir = path.resolve(buildDir);
158158

159159
const promise = getNextPagesFromBuildDir(buildDir).then(nextPages => {
@@ -182,7 +182,7 @@ describe("getNextPagesFromBuildDir", () => {
182182
it("should skip page directories", () => {
183183
expect.assertions(1);
184184

185-
const buildDir = path.normalize("./build");
185+
const buildDir = path.normalize("./sls-next-build");
186186
const resolvedBuildDir = path.resolve(buildDir);
187187
fs.lstatSync.mockReturnValue({ isDirectory: () => true });
188188

0 commit comments

Comments
 (0)