Skip to content

Commit 3a41a11

Browse files
committed
fix tests on windows
1 parent c1d2e8f commit 3a41a11

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

packages/core/integration-tests/test/react-server.js

+13-8
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ describe('react server components', function () {
9393
assert.equal(result.type.$$name, 'Client');
9494
assert.equal(typeof result.type.$$id, 'string');
9595
assert.deepEqual(result.type.$$bundles, [
96-
path.relative(bundles[1].target.distDir, bundles[1].filePath),
96+
path.posix.relative(bundles[1].target.distDir, bundles[1].filePath),
9797
]);
9898
});
9999

@@ -668,7 +668,8 @@ describe('react server components', function () {
668668
);
669669
assert.equal(
670670
link.props.href,
671-
'/' + path.relative(cssBundle.target.distDir, cssBundle.filePath),
671+
'/' +
672+
path.posix.relative(cssBundle.target.distDir, cssBundle.filePath),
672673
);
673674
});
674675

@@ -730,7 +731,8 @@ describe('react server components', function () {
730731
);
731732
assert.equal(
732733
link.props.href,
733-
'/' + path.relative(cssBundle.target.distDir, cssBundle.filePath),
734+
'/' +
735+
path.posix.relative(cssBundle.target.distDir, cssBundle.filePath),
734736
);
735737
});
736738

@@ -792,7 +794,8 @@ describe('react server components', function () {
792794
);
793795
assert.equal(
794796
link.props.href,
795-
'/' + path.relative(cssBundle.target.distDir, cssBundle.filePath),
797+
'/' +
798+
path.posix.relative(cssBundle.target.distDir, cssBundle.filePath),
796799
);
797800
});
798801

@@ -862,7 +865,7 @@ describe('react server components', function () {
862865
let entryBundle = b.getBundles()[2];
863866
assert.equal(
864867
res.output.Server.bootstrapScript,
865-
`Promise.all([import("/${path.relative(
868+
`Promise.all([import("/${path.posix.relative(
866869
entryBundle.target.distDir,
867870
entryBundle.filePath,
868871
)}")]).then(()=>${parcelRequireName}("${b.getAssetPublicId(
@@ -934,7 +937,7 @@ describe('react server components', function () {
934937
assert.equal(typeof result.props.children[1].type.$$id, 'string');
935938
let jsBundle = b.getBundles()[1];
936939
assert.deepEqual(result.props.children[1].type.$$bundles, [
937-
path.relative(jsBundle.target.distDir, jsBundle.filePath),
940+
path.posix.relative(jsBundle.target.distDir, jsBundle.filePath),
938941
]);
939942

940943
let link = result.props.children[0];
@@ -948,7 +951,8 @@ describe('react server components', function () {
948951
);
949952
assert.equal(
950953
link.props.href,
951-
'/' + path.relative(cssBundle.target.distDir, cssBundle.filePath),
954+
'/' +
955+
path.posix.relative(cssBundle.target.distDir, cssBundle.filePath),
952956
);
953957
});
954958

@@ -1011,7 +1015,8 @@ describe('react server components', function () {
10111015
);
10121016
assert.equal(
10131017
link.props.href,
1014-
'/' + path.relative(cssBundle.target.distDir, cssBundle.filePath),
1018+
'/' +
1019+
path.posix.relative(cssBundle.target.distDir, cssBundle.filePath),
10151020
);
10161021
});
10171022
},

0 commit comments

Comments
 (0)