From 15f4381cf54901895836551a30f66c0cee974a0c Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Mon, 23 Jan 2017 20:42:02 +0000 Subject: Move target URI handling out of zipfile module --- test/docx/uris.tests.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 test/docx/uris.tests.js (limited to 'test/docx') diff --git a/test/docx/uris.tests.js b/test/docx/uris.tests.js new file mode 100644 index 0000000..5b2afab --- /dev/null +++ b/test/docx/uris.tests.js @@ -0,0 +1,22 @@ +var assert = require("assert"); + +var zipfile = require("../../lib/docx/uris"); +var test = require("../test")(module); + + +test("uriToZipEntryName", { + "when path does not have leading slash then path is resolved relative to base": function() { + assert.equal( + zipfile.uriToZipEntryName("one/two", "three/four"), + "one/two/three/four" + ) + }, + + "when path has leading slash then base is ignored": function() { + assert.equal( + zipfile.uriToZipEntryName("one/two", "/three/four"), + "three/four" + ) + } +}); + -- cgit v1.2.3