Skip to content

Commit 1b6ea60

Browse files
committed
Address Playground CLI test failures
1 parent 6326e81 commit 1b6ea60

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

packages/playground/cli/src/run-cli.ts

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -565,14 +565,13 @@ export async function runCLI(args: RunCLIArgs): Promise<RunCLIServer> {
565565
'home',
566566
];
567567

568-
if (args['mount-before-install'] === undefined) {
569-
args['mount-before-install'] = [];
570-
}
571-
572568
for (const subdirName of userProvidableNativeSubdirs) {
573-
const thisSubdirDoesNotHaveAMount = !args[
574-
'mount-before-install'
575-
].some(isMountingVfsDirName(subdirName));
569+
const isMountingSubdirName = (mount: Mount) =>
570+
mount.vfsPath === `/${subdirName}`;
571+
const thisSubdirDoesNotHaveAMount = !(
572+
args['mount-before-install']?.some(isMountingSubdirName) ||
573+
args['mount']?.some(isMountingSubdirName)
574+
);
576575
if (thisSubdirDoesNotHaveAMount) {
577576
// The user isn't already mounting a native dir for this,
578577
// so let's create a mount from within our native temp dir.
@@ -582,6 +581,10 @@ export async function runCLI(args: RunCLIArgs): Promise<RunCLIServer> {
582581
);
583582
mkdirSync(nativeSubdirPath);
584583

584+
if (args['mount-before-install'] === undefined) {
585+
args['mount-before-install'] = [];
586+
}
587+
585588
// Make the real mount first so any further subdirs are mounted into it.
586589
args['mount-before-install'].unshift({
587590
vfsPath: `/${subdirName}`,
@@ -905,12 +908,6 @@ async function zipSite(
905908
fs.writeFileSync(outfile, zip);
906909
}
907910

908-
function isMountingVfsDirName(dirName: string) {
909-
return function matchesDirName(mount: Mount) {
910-
return mount.vfsPath === `/${dirName}`;
911-
};
912-
}
913-
914911
const tempDirNameDelimiter = '-playground-cli-site-';
915912

916913
function generateTempDirPrefix() {

packages/playground/cli/tests/run-cli.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ describe.each(blueprintVersions)(
531531
'Running the Blueprint...',
532532
'Finished running the blueprint',
533533
expect.stringMatching(
534-
/^WordPress is running on http:\/\/127\.0\.0\.1:\d+$/
534+
/^WordPress is running on http:\/\/127\.0\.0\.1:\d+ with \d+ worker\(s\)$/
535535
),
536536
])
537537
);

0 commit comments

Comments
 (0)