Skip to content

Commit

Permalink
Fix test on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
uga-rosa committed Dec 7, 2023
1 parent 96f87ed commit b1e14c8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions denops/denippet/loader.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Denops } from "./deps/denops.ts";
import { TOML, YAML } from "./deps/std.ts";
import { path, TOML, YAML } from "./deps/std.ts";
import { is, u } from "./deps/unknownutil.ts";
import { asyncFilter } from "./util.ts";

Expand Down Expand Up @@ -136,7 +136,8 @@ export class Loader {
let snippets: NormalizedSnippet[] = [];

if (extension === "ts") {
const content = await import(filepath).then((module) => module.snippets);
const content = await import(path.toFileUrl(filepath).toString())
.then((module) => module.snippets);
u.assert(content, is.RecordOf(isTSSnippet));
snippets = Object.entries(content).map(([name, snip]) => ({
...snip,
Expand Down
3 changes: 2 additions & 1 deletion denops/denippet/loader_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { Loader } from "./loader.ts";
import { op, test } from "./deps/denops.ts";
import { assertEquals, path } from "./deps/std.ts";

const testDataDir = new URL("../../test/data", import.meta.url).pathname;
const pluginRoot = path.fromFileUrl(new URL("../..", import.meta.url));
const testDataDir = path.join(pluginRoot, "test", "data");

test({
mode: "all",
Expand Down

0 comments on commit b1e14c8

Please sign in to comment.