Merge pull request #461 from ryanxcharles/test/break-up-BIP39-tests

break up BIP39 tests so the individual ones run faster
This commit is contained in:
Ryan X. Charles 2014-07-25 19:47:47 -04:00
commit f2f4ca7747
1 changed files with 19 additions and 12 deletions

View File

@ -144,9 +144,13 @@ describe('BIP39', function() {
it('should generate a mnemonic phrase', function() {
var phrase = BIP39.mnemonic(BIP39WordlistEn, 128);
});
it('should pass test vectors', function() {
//do not run these slow tests on TRAVIS which often fails
var vectors = bip39_vectors['english'];
if (!process.env.TRAVIS && !process.env.CI) {
for (var v = 0 ; v < vectors.length ; v++) {
(function(v){
it('should pass test vector ' + v, function() {
var vector = vectors[v];
var code = vector[0];
var mnemonic = vector[1];
@ -156,8 +160,11 @@ describe('BIP39', function() {
BIP39.check(BIP39WordlistEn, mnemonic).should.be.true;
mnemonic1.should.equal(mnemonic);
seed1.toString('hex').should.equal(seed)
}
});
})(v);
}
}
});
});