Skip to content

Commit

Permalink
Fix Windows tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zachleat committed Aug 25, 2023
1 parent 64da172 commit 1eaddf1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/mainTest.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const test = require("ava");
const { TemplatePath } = require("@11ty/eleventy-utils");
const DependencyTree = require("../main.js");

test("Nonexistent", t => {
Expand Down Expand Up @@ -75,8 +76,11 @@ test("only node_modules", t => {
});

test("getNodeModuleName", t => {
t.is(DependencyTree.getNodeModuleName("./eleventy-dependency-tree/node_modules/lodash/lodash.js"), "lodash");
t.is(DependencyTree.getNodeModuleName("./eleventy-dependency-tree/node_modules/@sindresorhus/is/dist/index.js"), "@sindresorhus/is");
let p1 = TemplatePath.normalizeOperatingSystemFilePath("./eleventy-dependency-tree/node_modules/lodash/lodash.js")
t.is(DependencyTree.getNodeModuleName(p1), "lodash");

let p2 = TemplatePath.normalizeOperatingSystemFilePath("./eleventy-dependency-tree/node_modules/@sindresorhus/is/dist/index.js")
t.is(DependencyTree.getNodeModuleName(p2), "@sindresorhus/is");
});

test("both files and node_modules", t => {
Expand Down

0 comments on commit 1eaddf1

Please sign in to comment.