Fix assert unreachable, remove unused variables (#13753)

Small code cleanup
This commit is contained in:
Félix Malfait
2025-08-08 09:04:45 +02:00
committed by GitHub
parent 8b4b9ef8da
commit 0236f79ccf
105 changed files with 172 additions and 315 deletions
@@ -1,13 +0,0 @@
import { assertUnreachable } from '@/workflow/utils/assertUnreachable';
it('throws when argument is not never', () => {
expect(() => {
assertUnreachable(42 as never);
}).toThrow();
});
it('throws with the provided error message when argument is not never', () => {
expect(() => {
assertUnreachable(42 as never, 'Custom error!');
}).toThrow('Custom error!');
});
@@ -1,3 +0,0 @@
export const assertUnreachable = (x: never, errorMessage?: string): never => {
throw new Error(errorMessage ?? "Didn't expect to get here.");
};