chalk/test/constructor.js
2019-01-26 21:53:23 +00:00

15 lines
354 B
JavaScript

import test from 'ava';
const chalk = require('..');
test('Chalk.constructor should throw an expected error', t => {
const expectedError = t.throws(() => {
chalk.constructor();
});
t.is(expectedError.message, 'Chalk.constructor() is deprecated. Use new Chalk.instance() instead.');
t.throws(() => {
new chalk.constructor();
});
});