Skip to content

Commit 5751226

Browse files
Stanisław Jarosnovemberborn
authored andcommitted
Added few tests for lib/chalk.js
1 parent 7d10446 commit 5751226

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/chalk.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
'use strict';
2+
const {test} = require('tap');
3+
const chalk = require('../lib/chalk');
4+
5+
test('throws an error when trying to access chalk config and chalk config is not configured', t => {
6+
t.throws(chalk.get, 'Chalk has not yet been configured');
7+
t.end();
8+
});
9+
10+
test('throws an error when trying to set chalk config and chalk config is configured', t => {
11+
chalk.set({});
12+
t.throws(chalk.set, 'Chalk has already been configured');
13+
t.end();
14+
});

0 commit comments

Comments
 (0)