Test cleanup and fixes [g-h]

This commit is contained in:
Angelos Chalaris
2018-06-18 16:57:55 +03:00
parent 382c452858
commit 7e9aae6f13
26 changed files with 113 additions and 168 deletions

View File

@ -1,17 +1,15 @@
const expect = require('expect');
const hexToRGB = require('./hexToRGB.js');
test('hexToRGB is a Function', () => {
test('hexToRGB is a Function', () => {
expect(hexToRGB).toBeInstanceOf(Function);
});
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('#27ae60ff')).toBe('rgba(39, 174, 96, 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('27ae60')).toBe('rgb(39, 174, 96)');
});
test('Converts a color code to a rgb() or rgba() string', () => {
expect(hexToRGB('#fff'), 'rgb(255, 255).toBe(255)')
test('Converts a color code to a rgb() or rgba() string', () => {
expect(hexToRGB('#fff')).toBe('rgb(255, 255, 255)');
});