Skip to content

Commit

Permalink
Added few tests for lib/chalk.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Stanis艂aw Jaros authored and novemberborn committed Feb 25, 2019
1 parent 7d10446 commit 5751226
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/chalk.js
@@ -0,0 +1,14 @@
'use strict';
const {test} = require('tap');
const chalk = require('../lib/chalk');

test('throws an error when trying to access chalk config and chalk config is not configured', t => {
t.throws(chalk.get, 'Chalk has not yet been configured');
t.end();
});

test('throws an error when trying to set chalk config and chalk config is configured', t => {
chalk.set({});
t.throws(chalk.set, 'Chalk has already been configured');
t.end();
});

0 comments on commit 5751226

Please sign in to comment.