Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- describe('rgb to hex', () => {
- it('Should take three integer numbers', () => {
- let returnValue = rgbToHexColor(22, 12, 3);
- expect(returnValue).to.be.an('string');
- });
- it('Should return undefined', () => {
- let returnValue = rgbToHexColor('22', 12, 3);
- expect(returnValue).to.be.undefined;
- });
- it('Should return undefined one', () => {
- let returnValue = rgbToHexColor();
- expect(returnValue).to.be.undefined;
- });
- it('Should return undefined two', () => {
- let returnValue = rgbToHexColor(12, 22);
- expect(returnValue).to.be.undefined;
- });
- it('Should return undefined three', () => {
- let returnValue = rgbToHexColor('sasdasd');
- expect(returnValue).to.be.undefined;
- });
- it('Should return undefined four', () => {
- let returnValue = rgbToHexColor(-2, 22, 12);
- expect(returnValue).to.be.undefined;
- });
- it('Should return undefined five', () => {
- let returnValue = rgbToHexColor(342, 22, 12);
- expect(returnValue).to.be.undefined;
- });
- it('Should be in hexadecimal format', () => {
- let returnValue = rgbToHexColor(32, 22, 12);
- expect(/^#[0-9A-F]{6}$/i.test(returnValue)).to.be.true;
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement