test.js 1015 B

123456789101112131415161718192021222324252627
  1. const { it, describe } = require('mocha');
  2. const assume = require('assume');
  3. const kuler = require('./');
  4. describe('kuler', function () {
  5. it('renders colors in the terminal', function () {
  6. console.log(' VISUAL INSPECTION');
  7. console.log(' '+ kuler('red').style('red'));
  8. console.log(' '+ kuler('black').style('#000'));
  9. console.log(' '+ kuler('white').style('#FFFFFF'));
  10. console.log(' '+ kuler('lime').style('AAFF5B'));
  11. console.log(' '+ kuler('violet').style('violetred 1'));
  12. console.log(' '+ kuler('purple').style('purple'));
  13. console.log(' '+ kuler('purple').style('purple'), 'correctly reset to normal color');
  14. console.log(' '+ kuler('green', 'green'));
  15. });
  16. it('supports color names and hex values', function () {
  17. assume(kuler('black', 'black')).equals(kuler('black', '#000'));
  18. })
  19. describe('#style', function () {
  20. it('has a style method', function () {
  21. assume(kuler('what').style).is.a('function');
  22. });
  23. });
  24. });