use to.have.lengthOf

This commit is contained in:
Fabio Berger 2017-05-30 10:49:34 +02:00
parent 1e69d2d1e1
commit 4d63a4d02a

View File

@ -31,12 +31,12 @@ describe('TokenRegistryWrapper', () => {
describe('#getTokensAsync', () => { describe('#getTokensAsync', () => {
it('should return all the tokens added to the tokenRegistry during the migration', async () => { it('should return all the tokens added to the tokenRegistry during the migration', async () => {
const tokens = await zeroEx.tokenRegistry.getTokensAsync(); const tokens = await zeroEx.tokenRegistry.getTokensAsync();
expect(tokens.length).to.be.equal(TOKEN_REGISTRY_SIZE_AFTER_MIGRATION); expect(tokens).to.have.lengthOf(TOKEN_REGISTRY_SIZE_AFTER_MIGRATION);
const schemaValidator = new SchemaValidator(); const schemaValidator = new SchemaValidator();
_.each(tokens, token => { _.each(tokens, token => {
const validationResult = schemaValidator.validate(token, tokenSchema); const validationResult = schemaValidator.validate(token, tokenSchema);
expect(validationResult.errors.length).to.be.equal(0); expect(validationResult.errors).to.have.lengthOf(0);
}); });
}); });
}); });