Test cleanup and fixes [c-d]
This commit is contained in:
@ -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)')
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user