added unit testing, and started implementing unit tests...phew

This commit is contained in:
Josh Burman
2019-03-12 22:28:02 -04:00
parent 74aad4a957
commit e8c2539f1b
3489 changed files with 464813 additions and 88 deletions

33
node_modules/colornames/test.js generated vendored Normal file
View File

@ -0,0 +1,33 @@
var test = require('tape')
var toHex = require('./index.js')
test('maps VGA color names to HEX values', function(t) {
t.plan(3)
t.equal(toHex('red'), '#FF0000')
t.equal(toHex('blue'), '#0000FF')
t.equal(toHex('BluE'), '#0000FF')
})
test('maps CSS color names to HEX values', function(t) {
t.plan(3)
t.equal(toHex('lightsalmon'), '#FFA07A')
t.equal(toHex('mediumvioletred'), '#C71585')
t.equal(toHex('meDiumVioletRed'), '#C71585')
})
test('meta data about a color', function(t) {
t.plan(2)
t.deepEqual(toHex.get('red'), {
name: "red",
css: true,
value: "#FF0000",
vga: true
})
t.deepEqual(toHex.get('rEd'), {
name: "red",
css: true,
value: "#FF0000",
vga: true
})
})