Skip to content

Commit dce699e

Browse files
committed
refactor(utils): remove unused
1 parent d3412e9 commit dce699e

3 files changed

Lines changed: 2 additions & 30 deletions

File tree

_dev_deps.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ export { describe, it } from "https://deno.land/std@0.177.0/testing/bdd.ts";
22
export {
33
assert,
44
assertEquals,
5-
assertThrows,
65
} from "https://deno.land/std@0.177.0/testing/asserts.ts";
76
export {
87
assertSpyCalls,

utils.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
// Copyright 2023-latest the httpland authors. All rights reserved. MIT license.
22
// This module is browser compatible.
33

4-
export function assert(
5-
expr: unknown,
6-
message = "Assertion failed",
7-
): asserts expr {
8-
if (!expr) {
9-
throw new Error(message);
10-
}
11-
}
12-
134
export function matchMethod(
145
candidates: readonly string[],
156
method: string,

utils_test.ts

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,5 @@
1-
import {
2-
assert as $assert,
3-
assertEquals,
4-
assertThrows,
5-
describe,
6-
it,
7-
} from "./_dev_deps.ts";
8-
import { assert, matchMethod } from "./utils.ts";
9-
10-
describe("assert", () => {
11-
it("should not throw error when the input is truthy", () => {
12-
assert(" ");
13-
assert("0");
14-
});
15-
16-
it("should throw error when the input is falsy", () => {
17-
assertThrows(() => assert(0));
18-
assertThrows(() => assert(""));
19-
});
20-
});
1+
import { assert as $assert, assertEquals, describe, it } from "./_dev_deps.ts";
2+
import { matchMethod } from "./utils.ts";
213

224
describe("matchMethod", () => {
235
it("should match when the input is empty list", () => {

0 commit comments

Comments
 (0)