Skip to content

Commit 833d5dc

Browse files
committed
handle errors in tests better
1 parent 7fbae99 commit 833d5dc

File tree

18 files changed

+18
-18
lines changed

18 files changed

+18
-18
lines changed

exercises/03.resources/01.problem.simple/src/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ async function setupClient({ capabilities }: ClientOptions = {}) {
4040
await client.transport?.close()
4141
// give things a moment to release locks and whatnot
4242
await new Promise((r) => setTimeout(r, 100))
43-
await fs.unlink(EPIC_ME_DB_PATH)
43+
await fs.unlink(EPIC_ME_DB_PATH).catch(() => {}) // ignore missing file
4444
},
4545
}
4646
}

exercises/03.resources/01.solution.simple/src/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ async function setupClient({ capabilities }: ClientOptions = {}) {
4040
await client.transport?.close()
4141
// give things a moment to release locks and whatnot
4242
await new Promise((r) => setTimeout(r, 100))
43-
await fs.unlink(EPIC_ME_DB_PATH)
43+
await fs.unlink(EPIC_ME_DB_PATH).catch(() => {}) // ignore missing file
4444
},
4545
}
4646
}

exercises/03.resources/02.problem.template/src/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ async function setupClient({ capabilities }: ClientOptions = {}) {
4040
await client.transport?.close()
4141
// give things a moment to release locks and whatnot
4242
await new Promise((r) => setTimeout(r, 100))
43-
await fs.unlink(EPIC_ME_DB_PATH)
43+
await fs.unlink(EPIC_ME_DB_PATH).catch(() => {}) // ignore missing file
4444
},
4545
}
4646
}

exercises/03.resources/02.solution.template/src/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ async function setupClient({ capabilities }: ClientOptions = {}) {
4040
await client.transport?.close()
4141
// give things a moment to release locks and whatnot
4242
await new Promise((r) => setTimeout(r, 100))
43-
await fs.unlink(EPIC_ME_DB_PATH)
43+
await fs.unlink(EPIC_ME_DB_PATH).catch(() => {}) // ignore missing file
4444
},
4545
}
4646
}

exercises/03.resources/03.problem.list/src/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ async function setupClient({ capabilities }: ClientOptions = {}) {
4040
await client.transport?.close()
4141
// give things a moment to release locks and whatnot
4242
await new Promise((r) => setTimeout(r, 100))
43-
await fs.unlink(EPIC_ME_DB_PATH)
43+
await fs.unlink(EPIC_ME_DB_PATH).catch(() => {}) // ignore missing file
4444
},
4545
}
4646
}

exercises/03.resources/03.solution.list/src/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ async function setupClient({ capabilities }: ClientOptions = {}) {
4040
await client.transport?.close()
4141
// give things a moment to release locks and whatnot
4242
await new Promise((r) => setTimeout(r, 100))
43-
await fs.unlink(EPIC_ME_DB_PATH)
43+
await fs.unlink(EPIC_ME_DB_PATH).catch(() => {}) // ignore missing file
4444
},
4545
}
4646
}

exercises/03.resources/04.problem.completion/src/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ async function setupClient({ capabilities }: ClientOptions = {}) {
4040
await client.transport?.close()
4141
// give things a moment to release locks and whatnot
4242
await new Promise((r) => setTimeout(r, 100))
43-
await fs.unlink(EPIC_ME_DB_PATH)
43+
await fs.unlink(EPIC_ME_DB_PATH).catch(() => {}) // ignore missing file
4444
},
4545
}
4646
}

exercises/03.resources/04.solution.completion/src/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ async function setupClient({ capabilities }: ClientOptions = {}) {
4040
await client.transport?.close()
4141
// give things a moment to release locks and whatnot
4242
await new Promise((r) => setTimeout(r, 100))
43-
await fs.unlink(EPIC_ME_DB_PATH)
43+
await fs.unlink(EPIC_ME_DB_PATH).catch(() => {}) // ignore missing file
4444
},
4545
}
4646
}

exercises/04.resource-tools/01.problem.embedded/src/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ async function setupClient() {
3737
await client.transport?.close()
3838
// give things a moment to release locks and whatnot
3939
await new Promise((r) => setTimeout(r, 100))
40-
await fs.unlink(EPIC_ME_DB_PATH)
40+
await fs.unlink(EPIC_ME_DB_PATH).catch(() => {}) // ignore missing file
4141
},
4242
}
4343
}

exercises/04.resource-tools/01.solution.embedded/src/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ async function setupClient() {
3737
await client.transport?.close()
3838
// give things a moment to release locks and whatnot
3939
await new Promise((r) => setTimeout(r, 100))
40-
await fs.unlink(EPIC_ME_DB_PATH)
40+
await fs.unlink(EPIC_ME_DB_PATH).catch(() => {}) // ignore missing file
4141
},
4242
}
4343
}

0 commit comments

Comments
 (0)