-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
24 lines (16 loc) · 835 Bytes
/
Copy pathtest.js
File metadata and controls
24 lines (16 loc) · 835 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const asyncZip = require('./index');
const chai = require('chai');
var assert = chai.assert;
describe('asyncCompressString', function() {
it('should return a compressed version of the string passed into it.', async function() {
const expectedResult = "The string to compress";
const compressedResult = await asyncZip.asyncCompressString(expectedResult);
const deCompressedResult = await asyncZip.asyncDecompressString(compressedResult);
assert.equal(deCompressedResult, expectedResult);
});
it('should return an error when value to compress is not a string.', async function() {
const expectedResult = 1;
const compressedResult = await asyncZip.asyncCompressString(expectedResult);
assert.include(compressedResult.toString(),'TypeError [ERR_INVALID_ARG_TYPE]');
});
});