Require Node.js 12 and move to ESM

This commit is contained in:
Sindre Sorhus 2021-04-16 15:23:29 +07:00
parent 4dab5e1fb6
commit fa16f4ec37
22 changed files with 362 additions and 412 deletions

View file

@ -1,11 +1,9 @@
import path from 'path';
import {fileURLToPath} from 'url';
import test from 'ava';
import execa from 'execa';
import chalk from '../source/index.js';
// Spoof supports-color
require('./_supports-color')(__dirname);
const chalk = require('../source');
chalk.level = 1;
test('don\'t output colors when manually disabled', t => {
const oldLevel = chalk.level;
@ -40,6 +38,6 @@ test('propagate enable/disable changes from child colors', t => {
});
test('disable colors if they are not supported', async t => {
const {stdout} = await execa.node(path.join(__dirname, '_fixture'));
const {stdout} = await execa.node(fileURLToPath(new URL('./_fixture.js', import.meta.url)));
t.is(stdout, 'testout testerr');
});