8
8
} from '../utils/fixture.js'
9
9
import { generateRandomObjectID , startMockBlobStore } from '../utils/helpers.js'
10
10
import { LocalServer } from '../utils/local-server.js'
11
- import { platform } from 'process'
12
11
13
12
beforeEach < FixtureTestContext > ( async ( ctx ) => {
14
13
// set for each test a new deployID and siteID
@@ -19,11 +18,9 @@ beforeEach<FixtureTestContext>(async (ctx) => {
19
18
await startMockBlobStore ( ctx )
20
19
} )
21
20
22
- test . skipIf ( platform === 'win32' ) < FixtureTestContext > (
23
- 'should add request/response headers' ,
24
- async ( ctx ) => {
25
- await createFixture ( 'middleware' , ctx )
26
- await runPlugin ( ctx )
21
+ test < FixtureTestContext > ( 'should add request/response headers' , async ( ctx ) => {
22
+ await createFixture ( 'middleware' , ctx )
23
+ await runPlugin ( ctx )
27
24
28
25
const origin = await LocalServer . run ( async ( req , res ) => {
29
26
expect ( req . url ) . toBe ( '/test/next' )
@@ -50,11 +47,9 @@ test.skipIf(platform === 'win32')<FixtureTestContext>(
50
47
} ,
51
48
)
52
49
53
- test . skipIf ( platform === 'win32' ) < FixtureTestContext > (
54
- 'should add request/response headers when using src dir' ,
55
- async ( ctx ) => {
56
- await createFixture ( 'middleware-src' , ctx )
57
- await runPlugin ( ctx )
50
+ test < FixtureTestContext > ( 'should add request/response headers when using src dir' , async ( ctx ) => {
51
+ await createFixture ( 'middleware-src' , ctx )
52
+ await runPlugin ( ctx )
58
53
59
54
const origin = await LocalServer . run ( async ( req , res ) => {
60
55
expect ( req . url ) . toBe ( '/test/next' )
@@ -81,7 +76,7 @@ test.skipIf(platform === 'win32')<FixtureTestContext>(
81
76
} ,
82
77
)
83
78
84
- describe . skipIf ( platform === 'win32' ) ( 'redirect' , ( ) => {
79
+ describe ( 'redirect' , ( ) => {
85
80
test < FixtureTestContext > ( 'should return a redirect response' , async ( ctx ) => {
86
81
await createFixture ( 'middleware' , ctx )
87
82
await runPlugin ( ctx )
@@ -130,7 +125,7 @@ describe.skipIf(platform === 'win32')('redirect', () => {
130
125
} )
131
126
} )
132
127
133
- describe . skipIf ( platform === 'win32' ) ( 'rewrite' , ( ) => {
128
+ describe ( 'rewrite' , ( ) => {
134
129
test < FixtureTestContext > ( 'should rewrite to an external URL' , async ( ctx ) => {
135
130
await createFixture ( 'middleware' , ctx )
136
131
await runPlugin ( ctx )
@@ -190,12 +185,10 @@ describe.skipIf(platform === 'win32')('rewrite', () => {
190
185
} )
191
186
} )
192
187
193
- describe . skipIf ( platform === 'win32' ) (
194
- "aborts middleware execution when the matcher conditions don't match the request" ,
195
- ( ) => {
196
- test < FixtureTestContext > ( 'when the path is excluded' , async ( ctx ) => {
197
- await createFixture ( 'middleware' , ctx )
198
- await runPlugin ( ctx )
188
+ describe ( "aborts middleware execution when the matcher conditions don't match the request" , ( ) => {
189
+ test < FixtureTestContext > ( 'when the path is excluded' , async ( ctx ) => {
190
+ await createFixture ( 'middleware' , ctx )
191
+ await runPlugin ( ctx )
199
192
200
193
const origin = await LocalServer . run ( async ( req , res ) => {
201
194
expect ( req . url ) . toBe ( '/_next/data' )
@@ -238,8 +231,8 @@ describe.skipIf(platform === 'win32')(
238
231
functions : [ '___netlify-edge-handler-middleware' ] ,
239
232
origin,
240
233
url : '/foo' ,
241
- } )
242
-
234
+ } )
235
+
243
236
expect ( await response1 . text ( ) ) . toBe ( 'Hello from origin!' )
244
237
expect ( response1 . status ) . toBe ( 200 )
245
238
expect ( response1 . headers . has ( 'x-hello-from-middleware-res' ) ) . toBeTruthy ( )
@@ -305,7 +298,7 @@ describe.skipIf(platform === 'win32')(
305
298
} ,
306
299
)
307
300
308
- describe . skipIf ( platform === 'win32' ) ( 'should run middleware on data requests' , ( ) => {
301
+ describe ( 'should run middleware on data requests' , ( ) => {
309
302
test < FixtureTestContext > ( 'when `trailingSlash: false`' , async ( ctx ) => {
310
303
await createFixture ( 'middleware' , ctx )
311
304
await runPlugin ( ctx )
0 commit comments