Skip to content

Commit 5477fe4

Browse files
committed
Only test 'binary' encoding if there's Uint8Array
1 parent e40c0d2 commit 5477fe4

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

test/unittests.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -405,12 +405,14 @@ describe('encoding test', function() {
405405
});
406406
});
407407

408-
it('should return Uint8Array for "binary"', function(done) {
409-
scrypt(v.password, v.salt, { logN: v.logN, r: v.r, dkLen: v.dkLen, encoding: 'binary' }, function(out) {
410-
assert.ok(out instanceof Uint8Array);
411-
done();
408+
if (typeof Uint8Array !== 'undefined') {
409+
it('should return Uint8Array for "binary"', function(done) {
410+
scrypt(v.password, v.salt, { logN: v.logN, r: v.r, dkLen: v.dkLen, encoding: 'binary' }, function(out) {
411+
assert.ok(out instanceof Uint8Array);
412+
done();
413+
});
412414
});
413-
});
415+
}
414416

415417
it('should return Array for undefined', function(done) {
416418
scrypt(v.password, v.salt, { logN: v.logN, r: v.r, dkLen: v.dkLen }, function(out) {

0 commit comments

Comments
 (0)