Skip to content

Commit bdc13ab

Browse files
authored
No codegen-reference to givePort in tests (#3089)
This should simplify CJS test without `tsx` and overall it's redundant <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Optimized internal test generation tooling by streamlining program assembly logic and updating test content mappings for consistency. No user-facing changes. <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent df3ebb4 commit bdc13ab

1 file changed

Lines changed: 5 additions & 9 deletions

File tree

tools/make-tests.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,15 @@ const extractQuickStartFromReadme = async () => {
1414
.trim();
1515
};
1616

17-
const quickStart = await extractQuickStartFromReadme();
18-
const program = `
19-
import { givePort } from "../tools/ports";
20-
${quickStart}
21-
`;
17+
const program = await extractQuickStartFromReadme();
2218

2319
const examplePort = String(givePort("example"));
2420

2521
const testContent = {
26-
cjs: program.replace(examplePort, "givePort('cjs')"),
27-
esm: program.replace(examplePort, "givePort('esm')"),
28-
compat: program.replace(examplePort, "givePort('compat')"),
29-
issue952: quickStart.replace(/const/g, "export const"),
22+
cjs: program.replace(examplePort, String(givePort("cjs"))),
23+
esm: program.replace(examplePort, String(givePort("esm"))),
24+
compat: program.replace(examplePort, String(givePort("compat"))),
25+
issue952: program.replace(/const/g, "export const"),
3026
};
3127

3228
for (const testName in testContent) {

0 commit comments

Comments
 (0)