MCPcopy Create free account
hub / github.com/chartjs/Chart.js / needsBrowser

Function needsBrowser

test/setup.node.js:24–29  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

22// The chart helpers need a canvas in a page. In a unit spec they fail with the
23// rename that moves the file to the browsers, instead of a bare ReferenceError.
24function needsBrowser(name) {
25 return function() {
26 const file = relative(root, expect.getState().testPath).split(sep).join('/');
27 throw new Error(`${name} needs a browser: rename ${file} to drop .unit from its name`);
28 };
29}
30
31for (const name of ['acquireChart', 'afterEvent', 'releaseChart', 'triggerMouseEvent', 'waitForResize']) {
32 global[name] = needsBrowser(name);

Callers 1

setup.node.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected