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

Function commonjsFixtures

test/vitest.shared.js:38–53  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

36const fixtureFile = /\/test\/fixtures\/.+\.js$/;
37
38export function commonjsFixtures() {
39 return {
40 name: 'chartjs-commonjs-fixtures',
41 enforce: 'pre',
42 transform(code, id) {
43 if (!fixtureFile.test(id.split('?')[0]) || !code.includes('module.exports')) {
44 return null;
45 }
46 // Prepended on the first line, so line numbers in errors stay the file's.
47 return {
48 code: 'const module = {exports: {}}; ' + code + '\nexport default module.exports;\n',
49 map: null
50 };
51 }
52 };
53}

Callers 2

vitest.config.jsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected