Skip to content

Commit

Permalink
Fix tests on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
matz3 committed Mar 5, 2020
1 parent a689fd2 commit 774651a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/lib/ui5framework/npm/Installer.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const test = require("ava");
const sinon = require("sinon");
const path = require("path");

const Installer = require("../../../../lib/ui5Framework/npm/Installer");

Expand All @@ -19,8 +20,8 @@ test.serial("Installer: constructor", (t) => {
ui5HomeDir: "/ui5Home/"
});
t.true(installer instanceof Installer, "Constructor returns instance of class");
t.is(installer._baseDir, "/ui5Home/framework/packages");
t.is(installer._lockDir, "/ui5Home/framework/locks");
t.is(installer._baseDir, path.join("/ui5Home/", "framework", "packages"));
t.is(installer._lockDir, path.join("/ui5Home/", "framework", "locks"));
});

test.serial("Installer: constructor requires 'cwd'", (t) => {
Expand Down Expand Up @@ -48,7 +49,7 @@ test.serial("Installer: _getLockPath", async (t) => {
version: "1.2.3"
});

t.is(lockPath, "/ui5Home/framework/locks/package-@openui5-sap.ui.lib1@1.2.3.lock");
t.is(lockPath, path.join("/ui5Home/", "framework", "locks", "package-@openui5-sap.ui.lib1@1.2.3.lock"));
});

test.serial("Installer: _synchronize", async (t) => {
Expand All @@ -75,7 +76,7 @@ test.serial("Installer: _synchronize", async (t) => {
"_getLockPath should be called with expected args");

t.is(t.context.mkdirpStub.callCount, 1, "_mkdirp should be called once");
t.deepEqual(t.context.mkdirpStub.getCall(0).args, ["/ui5Home/framework/locks"],
t.deepEqual(t.context.mkdirpStub.getCall(0).args, [path.join("/ui5Home/", "framework", "locks")],
"_mkdirp should be called with expected args");

t.is(t.context.lockStub.callCount, 1, "_lock should be called once");
Expand Down

0 comments on commit 774651a

Please sign in to comment.