MCPcopy Create free account
hub / github.com/reactnativecn/react-native-update / stopServer

Function stopServer

Example/testHotUpdate/e2e/globalTeardown.js:8–23  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6const pidFile = path.join(projectRoot, '.e2e-artifacts/.server.pid');
7
8function stopServer() {
9 if (!fs.existsSync(pidFile)) {
10 return;
11 }
12
13 try {
14 const pid = Number(fs.readFileSync(pidFile, 'utf8').trim());
15 if (pid > 0) {
16 process.kill(pid, 'SIGTERM');
17 }
18 } catch {
19 // ignore stale pid
20 }
21
22 fs.rmSync(pidFile, { force: true });
23}
24
25module.exports = async () => {
26 try {

Callers 1

globalTeardown.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected