Skip to content

Commit

Permalink
Prefer denops’ test() to Deno.test()
Browse files Browse the repository at this point in the history
  • Loading branch information
kg8m committed Aug 16, 2024
1 parent 1b950b0 commit 6556da5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
6 changes: 4 additions & 2 deletions test/denops/detect-indent/buffer-cache_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ test({
},
});

Deno.test({
test({
mode: "all",
name: "isCache() returns true if the argument is a Cache",
fn() {
const cache = { prev: {} };
Expand All @@ -65,7 +66,8 @@ Deno.test({
},
});

Deno.test({
test({
mode: "all",
name: "isCache() returns false unless the argument is a Cache",
fn() {
const empty = {};
Expand Down
6 changes: 4 additions & 2 deletions test/denops/detect-indent/options_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ test({
},
});

Deno.test({
test({
mode: "all",
name: "isOptions() returns true if the argument is a Options",
fn() {
const nonExpandtabOptions: OptionsAsNonExpandtab = { expandtab: false };
Expand All @@ -77,7 +78,8 @@ Deno.test({
},
});

Deno.test({
test({
mode: "all",
name: "isOptions() returns false unless the argument is a Options",
fn() {
const withOnlyUnknownKeys = { foo: 42 };
Expand Down
8 changes: 6 additions & 2 deletions test/denops/detect-indent/util_test.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
// Use denops' test() instead of built-in Deno.test()
import { test } from "jsr:@denops/test@^3.0.2";
import { assertEquals } from "jsr:@std/assert@^1.0.2";
import { isEmptyObject } from "../../../denops/detect-indent/util.ts";

Deno.test({
test({
mode: "all",
name: "isEmptyObject() returns `true` when the argument is an empty object",
fn() {
assertEquals(isEmptyObject({}), true);
},
});

Deno.test({
test({
mode: "all",
name: "isEmptyObject() returns `false` when the argument object has contents",
fn() {
assertEquals(isEmptyObject({ foo: 1 }), false);
Expand Down

0 comments on commit 6556da5

Please sign in to comment.