Skip to content

Commit a51534f

Browse files
committed
chore: update tests to work on windows
1 parent 7073377 commit a51534f

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

test/templates/server.spec.ts

+5-10
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,6 @@ jest.mock(
6565
{ virtual: true },
6666
)
6767

68-
jest.mock(
69-
'server/app-paths-manifest.json',
70-
() => ({
71-
'/blog/(test)/[author]/[slug]/page': 'app/blog/[author]/[slug]/page.js',
72-
}),
73-
{ virtual: true },
74-
)
75-
7668
jest.mock(
7769
'routes-manifest.json',
7870
() => ({
@@ -113,6 +105,10 @@ jest.mock(
113105
{ virtual: true },
114106
)
115107

108+
const appPathsManifest = {
109+
'/blog/(test)/[author]/[slug]/page': 'app/blog/[author]/[slug]/page.js',
110+
}
111+
116112
let NetlifyNextServer: NetlifyNextServerType
117113
beforeAll(() => {
118114
const NextServer: NextServerType = require(getServerFile(__dirname, false)).default
@@ -125,8 +121,7 @@ beforeAll(() => {
125121
this.nextConfig = nextOptions.conf
126122
this.netlifyConfig = netlifyConfig
127123
this.renderOpts = { previewProps: {} }
128-
this.hasAppDir = Boolean(this.nextConfig?.experimental?.appDir)
129-
this.appPathsManifest = this.getAppPathsManifest()
124+
this.appPathsManifest = appPathsManifest
130125
}
131126
Object.setPrototypeOf(NetlifyNextServer, MockNetlifyNextServerConstructor)
132127
})

0 commit comments

Comments
 (0)