Skip to content

Commit

Permalink
failing tests for id coercion
Browse files Browse the repository at this point in the history
  • Loading branch information
tgriesser committed Feb 21, 2023
1 parent 4b3ebc7 commit 7051698
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ class NumberThing {
id: number;

constructor(n: number) {
if (typeof n !== 'number') {
throw new Error(`Expected NumberThing to receive number, saw ${typeof n} ${n}`);
}
this.id = n;
}
}
Expand All @@ -13,6 +16,9 @@ class BatchLoadableNumberThing {
id: number;

constructor(n: number) {
if (typeof n !== 'number') {
throw new Error(`Expected BatchLoadableNumberThing to receive number, saw ${typeof n} ${n}`);
}
this.id = n;
}
}
Expand Down

0 comments on commit 7051698

Please sign in to comment.