UNPKG

ava

Version:

Testing can be a drag. AVA helps you get it done.

21 lines (16 loc) 326 B
'use strict'; const chalk = require('chalk'); let ctx = null; exports.get = () => { if (!ctx) { throw new Error('Chalk has not yet been configured'); } return ctx; }; exports.set = options => { if (ctx) { throw new Error('Chalk has already been configured'); } ctx = new chalk.Instance(options); return ctx; };