Skip to content

Commit 41a6f5c

Browse files
committed
Address Playground CLI test failures
1 parent 1972698 commit 41a6f5c

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
@@ -587,14 +587,13 @@ export async function runCLI(args: RunCLIArgs): Promise<RunCLIServer> {
587587
'home',
588588
];
589589

590-
if (args['mount-before-install'] === undefined) {
591-
args['mount-before-install'] = [];
592-
}
593-
594590
for (const subdirName of userProvidableNativeSubdirs) {
595-
const thisSubdirDoesNotHaveAMount = !args[
596-
'mount-before-install'
597-
].some(isMountingVfsDirName(subdirName));
591+
const isMountingSubdirName = (mount: Mount) =>
592+
mount.vfsPath === `/${subdirName}`;
593+
const thisSubdirDoesNotHaveAMount = !(
594+
args['mount-before-install']?.some(isMountingSubdirName) ||
595+
args['mount']?.some(isMountingSubdirName)
596+
);
598597
if (thisSubdirDoesNotHaveAMount) {
599598
// The user isn't already mounting a native dir for this,
600599
// so let's create a mount from within our native temp dir.
@@ -604,6 +603,10 @@ export async function runCLI(args: RunCLIArgs): Promise<RunCLIServer> {
604603
);
605604
mkdirSync(nativeSubdirPath);
606605

606+
if (args['mount-before-install'] === undefined) {
607+
args['mount-before-install'] = [];
608+
}
609+
607610
// Make the real mount first so any further subdirs are mounted into it.
608611
args['mount-before-install'].unshift({
609612
vfsPath: `/${subdirName}`,
@@ -927,12 +930,6 @@ async function zipSite(
927930
fs.writeFileSync(outfile, zip);
928931
}
929932

930-
function isMountingVfsDirName(dirName: string) {
931-
return function matchesDirName(mount: Mount) {
932-
return mount.vfsPath === `/${dirName}`;
933-
};
934-
}
935-
936933
const tempDirNameDelimiter = '-playground-cli-site-';
937934

938935
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)