aboutsummaryrefslogtreecommitdiff
path: root/tests/unzip.tests.js
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2016-07-03 19:19:21 +0100
committerMichael Williamson <mike@zwobble.org>2016-07-03 19:20:00 +0100
commit0b56dfce42c3944cce47e284608e6806f4c839c3 (patch)
tree5f96f9c2908f1c5b00a7192e71d4c192abd7cf47 /tests/unzip.tests.js
parent627c4a755395e313234bdb1914d168392006c483 (diff)
Move tests to test for easier Mocha usage
Diffstat (limited to 'tests/unzip.tests.js')
-rw-r--r--tests/unzip.tests.js40
1 files changed, 0 insertions, 40 deletions
diff --git a/tests/unzip.tests.js b/tests/unzip.tests.js
deleted file mode 100644
index 994fb68..0000000
--- a/tests/unzip.tests.js
+++ /dev/null
@@ -1,40 +0,0 @@
-var fs = require("fs");
-var assert = require("assert");
-var path = require("path");
-
-var test = require("./testing").test;
-var unzip = require("../lib/unzip");
-var promises = require("../lib/promises");
-
-describe("unzip", function() {
- test("unzip fails if given empty object", function() {
- return unzip.openZip({}).then(function() {
- assert.ok(false, "Expected failure");
- }, function(error) {
- assert.equal("Could not find file in options", error.message);
- });
- });
-
- test("unzip can open local zip file", function() {
- var zipPath = path.join(__dirname, "test-data/hello.zip");
- return unzip.openZip({path: zipPath}).then(function(zipFile) {
- return zipFile.read("hello", "utf8");
- }).then(function(contents) {
- assert.equal(contents, "Hello world\n");
- });
- });
-
- test('unzip can open Buffer', function() {
- var zipPath = path.join(__dirname, "test-data/hello.zip");
- return promises.nfcall(fs.readFile, zipPath)
- .then(function(buffer) {
- return unzip.openZip({buffer: buffer});
- })
- .then(function(zipFile) {
- return zipFile.read("hello", "utf8");
- })
- .then(function(contents) {
- assert.equal(contents, "Hello world\n");
- });
- });
-});