Skip to content

Commit ab62504

Browse files
committed
fix tests
1 parent f61abc7 commit ab62504

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

test/fixtures.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,8 @@
165165
"sha256": "120fb6cffcf8b32c43e7225256c4f837a86548c92ccc35480805987cb70be17b",
166166
"sha512": "867f70cf1ade02cff3752599a3a53dc4af34c7a669815ae5d513554e1c8cf252",
167167
"sha224": "3c198cbdb9464b7857966bd05b7bc92bc1cc4e6e63155d4e490557fd85989497",
168-
"sha384": "c0e14f06e49e32d73f9f52ddf1d0c5c7191609233631dadd76a567db42b78676"
168+
"sha384": "c0e14f06e49e32d73f9f52ddf1d0c5c7191609233631dadd76a567db42b78676",
169+
"ripemd160": "b725258b125e0bacb0e2307e34feb16a4d0d6aed6cb4b0eee458fc1829020428"
169170
}
170171
},
171172
{
@@ -178,7 +179,8 @@
178179
"sha256": "120fb6cffcf8b32c43e7225256c4f837a86548c92ccc35480805987cb70be17b",
179180
"sha512": "867f70cf1ade02cff3752599a3a53dc4af34c7a669815ae5d513554e1c8cf252",
180181
"sha224": "3c198cbdb9464b7857966bd05b7bc92bc1cc4e6e63155d4e490557fd85989497",
181-
"sha384": "c0e14f06e49e32d73f9f52ddf1d0c5c7191609233631dadd76a567db42b78676"
182+
"sha384": "c0e14f06e49e32d73f9f52ddf1d0c5c7191609233631dadd76a567db42b78676",
183+
"ripemd160": "b725258b125e0bacb0e2307e34feb16a4d0d6aed6cb4b0eee458fc1829020428"
182184
}
183185
}
184186
],

test/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,38 +102,38 @@ function runTests (name, compat) {
102102

103103
t.throws(function () {
104104
compat.pbkdf2(['a'], 'salt', 1, 32, 'sha1', function () {})
105-
}, /Password must be a buffer or string/)
105+
}, /Password must be a Buffer, Uint8Array or string/)
106106

107107
t.throws(function () {
108108
compat.pbkdf2Sync(['a'], 'salt', 1, 32, 'sha1')
109-
}, /Password must be a buffer or string/)
109+
}, /Password must be a Buffer, Uint8Array or string/)
110110
})
111111

112112
tape(name + ' should throw if the salt is not a buffer or string or Uint8Array', function (t) {
113113
t.plan(2)
114114

115115
t.throws(function () {
116116
compat.pbkdf2('pass', ['salt'], 1, 32, 'sha1')
117-
}, /Salt must be a buffer or string/)
117+
}, /Salt must be a Buffer, Uint8Array or string/)
118118

119119
t.throws(function () {
120120
compat.pbkdf2Sync('pass', ['salt'], 1, 32, 'sha1')
121-
}, /Salt must be a buffer or string/)
121+
}, /Salt must be a Buffer, Uint8Array or string/)
122122
})
123123

124124
var algos = ['sha1', 'sha224', 'sha256', 'sha384', 'sha512', 'ripemd160']
125125
algos.forEach(function (algorithm) {
126126
fixtures.valid.forEach(function (f) {
127127
var key, salt
128128
if (f.keyUint8Array) {
129-
key = new Uint8Array(f.keyuint8)
129+
key = new Uint8Array(f.keyUint8Array)
130130
} else if (f.keyHex) {
131131
key = Buffer.from(f.keyHex, 'hex')
132132
} else {
133133
key = f.key
134134
}
135135
if (f.saltUint8Array) {
136-
salt = new Uint8Array(f.saltuint8)
136+
salt = new Uint8Array(f.saltUint8Array)
137137
} else if (f.saltHex) {
138138
salt = Buffer.from(f.saltHex, 'hex')
139139
} else {

0 commit comments

Comments
 (0)