Test cleanup and fixes [c-d]

This commit is contained in:
Angelos Chalaris
2018-06-18 16:34:04 +03:00
parent d29974ebc9
commit 105185c213
136 changed files with 805 additions and 484 deletions

View File

@ -5,7 +5,13 @@ const hexToRGB = require('./hexToRGB.js');
test('hexToRGB is a Function', () => {
expect(hexToRGB).toBeInstanceOf(Function);
});
t.equal(hexToRGB('#27ae60ff'), 'rgba(39, 174, 96, 255)', "Converts a color code to a rgb() or rgba() string");
t.equal(hexToRGB('27ae60'), 'rgb(39, 174, 96)', "Converts a color code to a rgb() or rgba() string");
t.equal(hexToRGB('#fff'), 'rgb(255, 255, 255)', "Converts a color code to a rgb() or rgba() string");
test('Converts a color code to a rgb() or rgba() string', () => {
expect(hexToRGB('#27ae60ff'), 'rgba(39, 174, 96).toBe(255)')
});
test('Converts a color code to a rgb() or rgba() string', () => {
expect(hexToRGB('27ae60'), 'rgb(39, 174).toBe(96)')
});
test('Converts a color code to a rgb() or rgba() string', () => {
expect(hexToRGB('#fff'), 'rgb(255, 255).toBe(255)')
});