MCPcopy
hub / github.com/mswjs/msw / installLibrary

Function installLibrary

test/modules/module-utils.ts:35–53  ·  view source on GitHub ↗
(projectPath: string)

Source from the content-addressed store, hash-verified

33}
34
35export async function installLibrary(projectPath: string) {
36 const TARBALL_PATH = await getLibraryTarball()
37
38 const output = spawnSync('pnpm', ['install', TARBALL_PATH], {
39 cwd: projectPath,
40 })
41
42 if (output.error) {
43 console.error(output.error)
44 return Promise.reject(
45 'Failed to install the library. See the stderr output above.',
46 )
47 }
48
49 /**
50 * @todo Assert that pnpm printed success:
51 * + msw 0.0.0-fetch.rc-11
52 */
53}

Callers 2

esm-node.test.tsFile · 0.90

Calls 2

getLibraryTarballFunction · 0.85
errorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…