Skip to content

Commit f62e672

Browse files
authored
test: fix npm bootstrap on windows machines (#955)
1 parent e6c85a7 commit f62e672

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

@packages/test/src/npm.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,11 @@ export async function bootstrap(fixture: string, directory?: string) {
4040
return cwd;
4141
}
4242

43-
function findParentPath(path: string, dirname: string): string | undefined {
44-
const rawFragments = path.split('/');
43+
function findParentPath(
44+
parentPath: string,
45+
dirname: string
46+
): string | undefined {
47+
const rawFragments = parentPath.split(path.sep);
4548

4649
const {matched, fragments} = rawFragments.reduceRight(
4750
({fragments, matched}, item) => {
@@ -58,5 +61,5 @@ function findParentPath(path: string, dirname: string): string | undefined {
5861
{fragments: rawFragments, matched: false}
5962
);
6063

61-
return matched ? fragments.join('/') : undefined;
64+
return matched ? fragments.join(path.sep) : undefined;
6265
}

0 commit comments

Comments
 (0)