-
Notifications
You must be signed in to change notification settings - Fork 0
/
testes.spec.js
23 lines (22 loc) · 864 Bytes
/
testes.spec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
let chai = require('chai');
let expect = chai.expect;
let cardValidatorTest = require('../lib/index');
describe('Card validator', () => {
describe('validate input', () => {
it('string has less than sixteen digits', () => {
expect(cardValidatorTest.cardValidator(121212121212121)).to.be.false;
});
it('string has more than nineteen digits', () => {
expect(cardValidatorTest.cardValidator(1234567891011121314)).to.be.false;
});
it('string has repeated numbers', () => {
expect(cardValidatorTest.cardValidator(11111111111111111111)).to.be.false;
});
it('string has number type', () => {
expect(cardValidatorTest.cardValidator(5367151096056004)).to.be.true;
});
it('string is a valid card number', () => {
expect(cardValidatorTest.cardValidator(5367151096056004)).to.be.true;
});
});
});