MCPcopy Create free account
hub / github.com/testing-library/user-event / installLib

Function installLib

scripts/setup.js:77–90  ·  view source on GitHub ↗
(name, dir)

Source from the content-addressed store, hash-verified

75}
76
77async function installLib(name, dir) {
78 return new Promise((res, rej) => {
79 const child = spawn('npm', ['i'], {cwd: dir})
80
81 process.stdout.write(`Installing library "${name}" at ${dir}\n`)
82
83 child.on('error', e => {
84 process.stdout.write(`${e.stack ?? String(e)}\n`)
85 })
86 child.on('exit', (code, signal) => {
87 code || signal ? rej(code) : res()
88 })
89 })
90}
91
92async function buildLib(name, dir) {
93 const {globals} = JSON.parse(await fs.readFile(`${dir}/package.json`))

Callers 1

setup.jsFile · 0.85

Calls 1

writeMethod · 0.80

Tested by

no test coverage detected