Skip to content

Commit

Permalink
chore: deno fmt; deno lint
Browse files Browse the repository at this point in the history
  • Loading branch information
crookse committed Dec 23, 2022
1 parent 5eac43d commit bf64d3f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/fake/fake_mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ export function createFake<OriginalConstructor, OriginalObject>(
methodName,
);

if (!((methodName as string) in (this.#original as Record<string, unknown>))) {
if (
!((methodName as string) in (this.#original as Record<string, unknown>))
) {
const typeSafeMethodName = String(methodName as string);

throw new FakeError(
Expand Down
4 changes: 3 additions & 1 deletion src/mock/mock_mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,9 @@ export function createMock<OriginalConstructor, OriginalObject>(
methodName,
);

if (!((methodName as string) in (this.#original as Record<string, unknown>))) {
if (
!((methodName as string) in (this.#original as Record<string, unknown>))
) {
const typeSafeMethodName = String(methodName);
throw new MockError(
`Method "${typeSafeMethodName}" does not exist.`,
Expand Down
2 changes: 1 addition & 1 deletion tests/deno/unit/mod/stub_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Deno.test("Stub()", async (t) => {

await t.step("throws error on Stub(null) calls", () => {
try {
const stub = Stub(null, "prop");
Stub(null, "prop");
} catch (error) {
assertEquals(error.message, "Cannot create a stub using Stub(null)");
}
Expand Down

0 comments on commit bf64d3f

Please sign in to comment.