Skip to content

Commit 363d925

Browse files
jhedlundclaude
andcommitted
test(desktop): make the fake Tauri CLI write through the producer path
The fake CLI resolved frontendDist against the config directory and then both wrote and read variant.txt there, so it agreed with itself no matter where the wrapper pointed frontendDist. Repointing the production override at <relative>/wrong-subdir still passed all three cases. Write through BUZZ_PROTECTED_BUILD_OUTPUT -- the absolute path the wrapper publishes for build-protected-feature-artifacts.mjs -- and keep the read on the config-resolved consumer path. The two only agree when the wrapper's relative frontendDist actually reaches the directory the build wrote to. Verified on this branch: - Unmodified wrapper: 3/3 pass. - frontendDist -> <relative>/wrong-subdir: 0/3 with this change, 3/3 without it. - Absolute-path regression restored: the relative/non-URL case still fails on the value it is meant to catch. - Desktop suite: 5843/5844. useDocumentVisible "focused polling pauses on blur" fails about 1 run in 3 in isolation; both of its files are byte-identical to the pre-PR commit, so it is unrelated. - biome check clean. Reported by Brain on behalf of wesbillman in review of #7177. Signed-off-by: Jeff Hedlund <[email protected]> Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
1 parent 1f80098 commit 363d925

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎desktop/src/protectedFeatures/tauriCommand.test.mjs‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,12 @@ const configured = override.build.frontendDist;
2525
// Tauri resolves frontendDist against the directory holding tauri.conf.json
2626
// (config_parent.join(path) in tauri-codegen), not against the process cwd.
2727
const output = path.resolve(process.env.BUZZ_TEST_CONFIG_DIR, configured);
28-
mkdirSync(output, { recursive: true });
29-
writeFileSync(path.join(output, "variant.txt"), process.env.VITE_BUZZ_BESTIE);
28+
// Write through the producer path the wrapper publishes and read back through
29+
// the config-resolved consumer path. Doing both against one path would make the
30+
// fake agree with itself no matter where the wrapper pointed frontendDist.
31+
const producer = process.env.BUZZ_PROTECTED_BUILD_OUTPUT;
32+
mkdirSync(producer, { recursive: true });
33+
writeFileSync(path.join(producer, "variant.txt"), process.env.VITE_BUZZ_BESTIE);
3034
await new Promise((resolve) => setTimeout(resolve, 100));
3135
const observed = readFileSync(path.join(output, "variant.txt"), "utf8");
3236
writeFileSync(

0 commit comments

Comments
 (0)