Skip to content

Commit 57bd3d6

Browse files
committed
Fix linter errors in sync-back.test.ts
1 parent 6e92af4 commit 57bd3d6

File tree

2 files changed

+25
-16
lines changed

2 files changed

+25
-16
lines changed

pr-checks/eslint.config.mjs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,17 @@ export default [
1414
{
1515
rules: {
1616
// The scripts in `pr-checks` are expected to output to the console.
17-
"no-console": "off"
18-
}
19-
}
17+
"no-console": "off",
18+
19+
"@typescript-eslint/no-floating-promises": [
20+
"error",
21+
{
22+
allowForKnownSafeCalls: [
23+
// Avoid needing explicit `void` in front of `describe` calls in test files.
24+
{ from: "package", name: ["describe"], package: "node:test" },
25+
],
26+
},
27+
],
28+
},
29+
},
2030
];

pr-checks/sync-back.test.ts

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ afterEach(() => {
3838
fs.rmSync(testDir, { recursive: true, force: true });
3939
});
4040

41-
describe("scanGeneratedWorkflows", () => {
42-
it("basic workflow scanning", () => {
41+
describe("scanGeneratedWorkflows", async () => {
42+
await it("basic workflow scanning", () => {
4343
/** Test basic workflow scanning functionality */
4444
const workflowContent = `
4545
name: Test Workflow
@@ -61,7 +61,7 @@ jobs:
6161
assert.equal(result["actions/setup-go"], "v6");
6262
});
6363

64-
it("scanning workflows with version comments", () => {
64+
await it("scanning workflows with version comments", () => {
6565
/** Test scanning workflows with version comments */
6666
const workflowContent = `
6767
name: Test Workflow
@@ -86,7 +86,7 @@ jobs:
8686
assert.equal(result["actions/setup-python"], "v6 # Latest Python");
8787
});
8888

89-
it("ignores local actions", () => {
89+
await it("ignores local actions", () => {
9090
/** Test that local actions (starting with ./) are ignored */
9191
const workflowContent = `
9292
name: Test Workflow
@@ -109,8 +109,8 @@ jobs:
109109
});
110110
});
111111

112-
describe("updateSyncTs", () => {
113-
it("updates sync.ts file", () => {
112+
describe("updateSyncTs", async () => {
113+
await it("updates sync.ts file", () => {
114114
/** Test updating sync.ts file */
115115
const syncTsContent = `
116116
const steps = [
@@ -141,7 +141,7 @@ const steps = [
141141
assert.ok(updatedContent.includes('uses: "actions/setup-go@v6"'));
142142
});
143143

144-
it("strips comments from versions", () => {
144+
await it("strips comments from versions", () => {
145145
/** Test updating sync.ts file when versions have comments */
146146
const syncTsContent = `
147147
const steps = [
@@ -168,7 +168,7 @@ const steps = [
168168
assert.ok(!updatedContent.includes("# Latest version"));
169169
});
170170

171-
it("returns false when no changes are needed", () => {
171+
await it("returns false when no changes are needed", () => {
172172
/** Test that updateSyncTs returns false when no changes are needed */
173173
const syncTsContent = `
174174
const steps = [
@@ -190,8 +190,8 @@ const steps = [
190190
});
191191
});
192192

193-
describe("updateTemplateFiles", () => {
194-
it("updates template files", () => {
193+
describe("updateTemplateFiles", async () => {
194+
await it("updates template files", () => {
195195
/** Test updating template files */
196196
const templateContent = `
197197
name: Test Template
@@ -220,7 +220,7 @@ steps:
220220
assert.ok(updatedContent.includes("uses: actions/setup-node@v5 # Latest"));
221221
});
222222

223-
it("preserves version comments", () => {
223+
await it("preserves version comments", () => {
224224
/** Test that updating template files preserves version comments */
225225
const templateContent = `
226226
name: Test Template
@@ -232,8 +232,7 @@ steps:
232232
fs.writeFileSync(templatePath, templateContent);
233233

234234
const actionVersions = {
235-
"ruby/setup-ruby":
236-
"55511735964dcb71245e7e55f72539531f7bc0eb # v1.257.0",
235+
"ruby/setup-ruby": "55511735964dcb71245e7e55f72539531f7bc0eb # v1.257.0",
237236
};
238237

239238
const result = updateTemplateFiles(checksDir, actionVersions);

0 commit comments

Comments
 (0)