Skip to content

Commit

Permalink
Supporting installing packages from file. Resolves #4.
Browse files Browse the repository at this point in the history
  • Loading branch information
joeldenning committed Oct 29, 2019
1 parent a897240 commit 4a015b2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/narn-lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ exports.getNpmArgs = narnArgs => {
};

function transformNarnPackageString(packageToAdd) {
packageToAdd = packageToAdd.replace("file:", "");
const packageNameWithoutVersion = packageToAdd.slice(
0,
packageToAdd.indexOf("@") > 0
Expand Down
8 changes: 8 additions & 0 deletions test/add.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,12 @@ describe("narn add", () => {
"[email protected]:joeldenning/narn.git#master"
]);
});

it("supports installing from file", () => {
expect(getNpmArgs(["add", "file:../local-package"])).toEqual([
"install",
"--save",
"../local-package"
]);
});
});

0 comments on commit 4a015b2

Please sign in to comment.