MCPcopy Create free account
hub / github.com/npm/cli / mockGetInstallScripts

Function mockGetInstallScripts

workspaces/arborist/test/install-scripts.js:3–13  ·  view source on GitHub ↗
(t, isNodeGypResult = () => false)

Source from the content-addressed store, hash-verified

1const t = require('tap')
2
3const mockGetInstallScripts = (t, isNodeGypResult = () => false) =>
4 t.mock('../lib/install-scripts.js', {
5 '@npmcli/node-gyp': {
6 isNodeGypPackage: async (path) => {
7 if (typeof isNodeGypResult === 'function') {
8 return isNodeGypResult(path)
9 }
10 return !!isNodeGypResult
11 },
12 },
13 })
14
15const node = ({
16 scripts = {},

Callers 1

install-scripts.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected