88} from '../utils/fixture.js'
99import { generateRandomObjectID , startMockBlobStore } from '../utils/helpers.js'
1010import { LocalServer } from '../utils/local-server.js'
11- import { platform } from 'process'
1211
1312beforeEach < FixtureTestContext > ( async ( ctx ) => {
1413 // set for each test a new deployID and siteID
@@ -19,11 +18,9 @@ beforeEach<FixtureTestContext>(async (ctx) => {
1918 await startMockBlobStore ( ctx )
2019} )
2120
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 )
2724
2825 const origin = await LocalServer . run ( async ( req , res ) => {
2926 expect ( req . url ) . toBe ( '/test/next' )
@@ -50,11 +47,9 @@ test.skipIf(platform === 'win32')<FixtureTestContext>(
5047 } ,
5148)
5249
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 )
5853
5954 const origin = await LocalServer . run ( async ( req , res ) => {
6055 expect ( req . url ) . toBe ( '/test/next' )
@@ -81,7 +76,7 @@ test.skipIf(platform === 'win32')<FixtureTestContext>(
8176 } ,
8277)
8378
84- describe . skipIf ( platform === 'win32' ) ( 'redirect' , ( ) => {
79+ describe ( 'redirect' , ( ) => {
8580 test < FixtureTestContext > ( 'should return a redirect response' , async ( ctx ) => {
8681 await createFixture ( 'middleware' , ctx )
8782 await runPlugin ( ctx )
@@ -130,7 +125,7 @@ describe.skipIf(platform === 'win32')('redirect', () => {
130125 } )
131126} )
132127
133- describe . skipIf ( platform === 'win32' ) ( 'rewrite' , ( ) => {
128+ describe ( 'rewrite' , ( ) => {
134129 test < FixtureTestContext > ( 'should rewrite to an external URL' , async ( ctx ) => {
135130 await createFixture ( 'middleware' , ctx )
136131 await runPlugin ( ctx )
@@ -190,12 +185,10 @@ describe.skipIf(platform === 'win32')('rewrite', () => {
190185 } )
191186} )
192187
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 )
199192
200193 const origin = await LocalServer . run ( async ( req , res ) => {
201194 expect ( req . url ) . toBe ( '/_next/data' )
@@ -238,8 +231,8 @@ describe.skipIf(platform === 'win32')(
238231 functions : [ '___netlify-edge-handler-middleware' ] ,
239232 origin,
240233 url : '/foo' ,
241- } )
242-
234+ } )
235+
243236 expect ( await response1 . text ( ) ) . toBe ( 'Hello from origin!' )
244237 expect ( response1 . status ) . toBe ( 200 )
245238 expect ( response1 . headers . has ( 'x-hello-from-middleware-res' ) ) . toBeTruthy ( )
@@ -305,7 +298,7 @@ describe.skipIf(platform === 'win32')(
305298 } ,
306299)
307300
308- describe . skipIf ( platform === 'win32' ) ( 'should run middleware on data requests' , ( ) => {
301+ describe ( 'should run middleware on data requests' , ( ) => {
309302 test < FixtureTestContext > ( 'when `trailingSlash: false`' , async ( ctx ) => {
310303 await createFixture ( 'middleware' , ctx )
311304 await runPlugin ( ctx )
0 commit comments