-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Improve test result accessibility #3082
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 8 commits
6e1dbb9
1c92630
93070fe
ef19867
017a45a
49fbe24
f1beca2
1b64bff
36d764c
9b45dc3
fcc1f07
0c0fd21
ee9f000
2449d74
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,23 @@ | ||
import {EventEmitter} from 'node:events'; | ||
|
||
import {Chalk} from 'chalk'; // eslint-disable-line unicorn/import-style | ||
|
||
let chalk = new Chalk(); // eslint-disable-line import/no-mutable-exports | ||
|
||
export {chalk}; | ||
|
||
let configured = false; | ||
const events = new EventEmitter(); | ||
const on = events.on.bind(events); | ||
const emit = events.emit.bind(events); | ||
export function set(options) { | ||
if (configured) { | ||
throw new Error('Chalk has already been configured'); | ||
} | ||
|
||
configured = true; | ||
chalk = new Chalk(options); | ||
emit('set', chalk); | ||
} | ||
|
||
export {on}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
'use strict'; | ||
const chalk = import('../chalk.js'); // eslint-disable-line node/no-unsupported-features/es-syntax | ||
let setChalk; | ||
chalk.then(chalk => { | ||
setChalk = chalk.set; | ||
}); | ||
|
||
let options = null; | ||
exports.get = () => { | ||
if (!options) { | ||
|
@@ -14,4 +20,11 @@ exports.set = newOptions => { | |
} | ||
|
||
options = newOptions; | ||
if (options.chalkOptions) { | ||
if (setChalk) { | ||
setChalk(options.chalkOptions); | ||
} else { | ||
chalk.then(chalk => chalk.set(options.chalkOptions)); | ||
} | ||
|
||
} | ||
}; |
Uh oh!
There was an error while loading. Please reload this page.