MCPcopy Index your code
hub / github.com/cookpete/react-player / test

Function test

scripts/tester/tester.js:30–48  ·  view source on GitHub ↗
(positionals, args)

Source from the content-addressed store, hash-verified

28}
29
30export async function test(positionals, args) {
31 // Set flag for running tests in development mode, required for `act()`.
32 args['define:process.env.NODE_ENV'] = '"development"';
33
34 // Set flag for adding stubs used in tests.
35 args['define:globalThis.__TEST__'] = 'true';
36
37 await build(positionals, args);
38
39 await cmd(`echo '{"type": "module"}' > ${args.outdir}/package.json`);
40
41 // Ignore test/helpers/ folder for running tests.
42 positionals = positionals.filter((p) => !p.startsWith('test/helpers/'));
43
44 for (let file of positionals) {
45 file = file.replace(/\.tsx?/, '.js');
46 console.log(await cmd(`node --enable-source-maps dist${file}`));
47 }
48}
49
50async function cmd(command, opts = {}) {
51 command = command.trim().replace(/\s+/g, ' ');

Callers 6

Player.test.tsxFile · 0.85
Player.tsxFile · 0.85
props.tsxFile · 0.85
staticMethods.jsFile · 0.85
canPlayFileFunction · 0.85
cliTestFunction · 0.85

Calls 2

buildFunction · 0.90
cmdFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…