Skip to content

Commit 08aca82

Browse files
committed
fix: resolve linting errors
1 parent a5f0b05 commit 08aca82

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

scripts/bin-test/test.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ async function retryUntil(
140140
await Promise.race([retry, timedOut]);
141141
}
142142

143-
144143
async function runHttpDiscovery(modulePath: string): Promise<DiscoveryResult> {
145144
const getPort = promisify(portfinder.getPort) as () => Promise<number>;
146145
const port = await getPort();
@@ -174,7 +173,7 @@ async function runHttpDiscovery(modulePath: string): Promise<DiscoveryResult> {
174173

175174
const res = await fetch(`http://localhost:${port}/__/functions.yaml`);
176175
const body = await res.text();
177-
176+
178177
if (res.status === 200) {
179178
const manifest = yaml.load(body) as Record<string, unknown>;
180179
return { success: true, manifest };
@@ -206,7 +205,7 @@ async function runStdioDiscovery(modulePath: string): Promise<DiscoveryResult> {
206205

207206
const timeoutId = setTimeout(() => {
208207
proc.kill(9);
209-
reject(new Error("Stdio discovery timed out after " + TIMEOUT_M + "ms"));
208+
reject(new Error(`Stdio discovery timed out after ${TIMEOUT_M}ms`));
210209
}, TIMEOUT_M);
211210

212211
proc.on("close", () => {
@@ -220,14 +219,14 @@ async function runStdioDiscovery(modulePath: string): Promise<DiscoveryResult> {
220219
resolve({ success: true, manifest });
221220
return;
222221
}
223-
222+
224223
// Try to parse error
225224
const errorMatch = stderr.match(/__FIREBASE_FUNCTIONS_MANIFEST_ERROR__:([\s\S]+)/);
226225
if (errorMatch) {
227226
resolve({ success: false, error: errorMatch[1] });
228227
return;
229228
}
230-
229+
231230
resolve({ success: false, error: "No manifest or error found" });
232231
});
233232

@@ -243,7 +242,7 @@ describe("functions.yaml", function () {
243242
this.timeout(TIMEOUT_XL);
244243

245244
function runDiscoveryTests(
246-
tc: Testcase,
245+
tc: Testcase,
247246
discoveryFn: (path: string) => Promise<DiscoveryResult>
248247
) {
249248
it("returns expected manifest", async function () {
@@ -395,8 +394,8 @@ describe("functions.yaml", function () {
395394
});
396395
}
397396
});
398-
399-
describe("error handling", function () {
397+
398+
describe("error handling", () => {
400399
const errorTestcases = [
401400
{
402401
name: "broken syntax",
@@ -413,7 +412,7 @@ describe("functions.yaml", function () {
413412
for (const tc of errorTestcases) {
414413
describe(tc.name, () => {
415414
for (const discovery of discoveryMethods) {
416-
it(`${discovery.name} discovery handles error correctly`, async function () {
415+
it(`${discovery.name} discovery handles error correctly`, async () => {
417416
const result = await discovery.fn(tc.modulePath);
418417
expect(result.success).to.be.false;
419418
expect(result.error).to.include(tc.expectedError);

0 commit comments

Comments
 (0)