Skip to content

Commit e899203

Browse files
committed
テストのエラーをsentryに流す
1 parent 5e9f65b commit e899203

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

app/terminal/page.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515
import { replTests } from "@my-code/runtime/tests/repl";
1616
import { fileExecutionTests } from "@my-code/runtime/tests/fileExecution";
1717
import { useRuntimeAll } from "@my-code/runtime/context";
18+
import { captureException } from "@sentry/nextjs";
1819

1920
import main_py from "./samples/main.py?raw";
2021
import main_rb from "./samples/main.rb?raw";
@@ -270,6 +271,13 @@ function MochaTest() {
270271
}
271272

272273
const runner = mocha.run();
274+
runner.on("fail", (test, err) => {
275+
captureException(err, {
276+
extra: {
277+
fullTitle: test.fullTitle(),
278+
},
279+
});
280+
});
273281
runner.on("end", () => {
274282
setMochaState("finished");
275283
});

0 commit comments

Comments
 (0)