Skip to content

Commit 04ac6d3

Browse files
committed
Make test compatible with IE9 and earlier
1 parent 1739eea commit 04ac6d3

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

test/unittests.js

+9-6
Original file line numberDiff line numberDiff line change
@@ -249,16 +249,19 @@ var inputs = [
249249
encoding: 'hex',
250250
result: 'c3f182ee2dec846e70a6942fb529985a3a09765ef04c612923b17f18555a37076deb2b9830d69de5492651e4506ae5776d96d40f67aaee37e1777b8ad5c3111432bb3b6f7e1264401879e641aea2bd0a21a124fd5c1ece0891338d2c44ba312e497bd93660fc053a5df35ade0ca48fd0f3c6c0f6143bb3548420a7cbf6ce7c82bc6b56c8e33adbf6fbac9e0ffc4aa9fb9fcd97fd393700b7d8eac55d45d4651bdb1a270c35c8d40a22e1b2429d6521c4c673e4ba7e7f4a9638ec3b1adbc6dcab64e211b5a26df8f274511be41228cd9a4fae3ada5236ebf39dfc6cd1864652a16516fb622502205d9fdbf09dc6fa964b57cc468ee8d98e4a00bf064222dafec8'
251251
},
252-
{
252+
];
253+
254+
if (typeof Uint8Array !== 'undefined') {
255+
inputs.push({
253256
password: new Uint8Array(65),
254257
salt: 'salt',
255258
logN: 1,
256259
r: 1,
257260
dkLen: 32,
258261
encoding: 'binary',
259262
result: [236, 122, 177, 168, 83, 62, 253, 45, 27, 145, 154, 151, 66, 174, 56, 101, 91, 130, 207, 52, 20, 52, 161, 66, 241, 202, 39, 120, 158, 73, 124, 69]
260-
}
261-
];
263+
});
264+
}
262265

263266
var shortInput = {
264267
password: 'password',
@@ -301,7 +304,7 @@ var inputsWithP = [
301304
describe('limits test', function() {
302305
var v = shortInput;
303306
var v2 = inputs[12];
304-
307+
305308
it('should throw with too small logN', function() {
306309
assert.throws(function() {
307310
scrypt(v.password, v.salt, 0, v.r, v.dkLen);
@@ -489,14 +492,14 @@ describe('async input/output test', function() {
489492
});
490493
it('input 9', function(done) {
491494
async_test(9, step, done);
492-
});
495+
});
493496
// the following two tests take a bit of time (~2.8s each),
494497
it('input 10', function(done) {
495498
async_test(10, step, done);
496499
});
497500
it('input 11', function(done) {
498501
async_test(11, step, done);
499-
});
502+
});
500503
// the following test tests long input
501504
it('input 12', function(done) {
502505
async_test(12, step, done);

0 commit comments

Comments
 (0)