MCPcopy Create free account
hub / github.com/cure53/DOMPurify / startServer

Function startServer

test/browser/legacy-runner.js:76–97  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

74}
75
76async function startServer() {
77 if (process.env.BASE_URL) {
78 return { base: process.env.BASE_URL, stop() {} };
79 }
80
81 const base = 'http://127.0.0.1:' + PORT;
82 if (await reachable(base + SUITES[0])) {
83 return { base, stop() {} };
84 }
85
86 const child = spawn(process.execPath, [path.join(__dirname, 'server.js')], {
87 stdio: 'ignore',
88 env: { ...process.env, PORT: String(PORT) },
89 });
90 await waitForServer(base);
91 return {
92 base,
93 stop() {
94 child.kill();
95 },
96 };
97}
98
99async function runSuite(browser, name, version, base) {
100 let failed = 0;

Callers 1

mainFunction · 0.85

Calls 2

reachableFunction · 0.85
waitForServerFunction · 0.85

Tested by

no test coverage detected