chalk/test/constructor.js
Richie Bendall 03067ebf3a
Keep ava on 2.x
Signed-off-by: Richie Bendall <richiebendall@gmail.com>
2020-10-04 07:16:12 +13:00

15 lines
386 B
JavaScript

import test from 'ava';
const chalk = require('../source');
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(); // eslint-disable-line no-new
});
});