Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: clean up some tests to avoid build error with stale output #7355

Merged
merged 3 commits into from
Apr 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions scripts/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,16 +143,14 @@ if (runtimeDocstrings) {
console.log("Running runtime docstrings tests");

const generated_mocha_test_res = path.join(
"tests",
"docstring_tests",
docstringTestDir,
"generated_mocha_test.res",
);

// Remove `generated_mocha_test.res` if file exists
if (fs.existsSync(generated_mocha_test_res)) {
console.log(`Removing ${generated_mocha_test_res}`);
fs.unlinkSync(generated_mocha_test_res);
}
await execClean([], {
cwd: docstringTestDir,
stdio: "inherit"
})

await execBuild([], {
cwd: docstringTestDir,
Expand Down Expand Up @@ -180,7 +178,7 @@ if (runtimeDocstrings) {

console.log("Run mocha test");
await mocha(
[path.join("tests", "docstring_tests", "generated_mocha_test.res.js")],
[path.join(docstringTestDir, "generated_mocha_test.res.js")],
{
cwd: projectDir,
stdio: "inherit",
Expand Down
3 changes: 2 additions & 1 deletion tests/build_tests/jsx_settings_inheritance/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import { setup } from "#dev/process";

const { execBuild } = setup(import.meta.dirname);
const { execBuild, execClean } = setup(import.meta.dirname);

await execClean()
await execBuild();
4 changes: 3 additions & 1 deletion tests/build_tests/transitive_pinned_dependency1/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import * as assert from "node:assert";
import { existsSync } from "node:fs";
import { setup } from "#dev/process";

const { execBuild } = setup("./a");
const { execBuild, execClean } = setup("./a");

await execClean()

const output = await execBuild();
console.log(output);
Expand Down
4 changes: 2 additions & 2 deletions tests/build_tests/transitive_pinned_dependency2/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import * as assert from "node:assert";
import { existsSync } from "node:fs";
import { setup } from "#dev/process";

const { execBuild } = setup("./a");

const { execBuild, execClean } = setup("./a");
await execClean()
const output = await execBuild();
console.log(output);

Expand Down