MCPcopy Index your code
hub / github.com/nodejs/node / mockOptions

Function mockOptions

deps/npm/test/lib/commands/diff.js:921–935  ·  view source on GitHub ↗
(t, config)

Source from the content-addressed store, hash-verified

919
920t.test('various options', async t => {
921 const mockOptions = async (t, config) => {
922 const file = (v) => new Array(50).fill(0).map((_, i) => `${i}${i === 20 ? v : ''}`).join('\n')
923 const mock = await mockDiff(t, {
924 diff: ['bar@2.0.0', 'bar@3.0.0'],
925 config,
926 exec: [],
927 tarballs: {
928 'bar@2.0.0': { 'index.js': file('2.0.0') },
929 'bar@3.0.0': { 'index.js': file('3.0.0') },
930 },
931 times: { bar: 2 },
932 })
933
934 return mock
935 }
936
937 t.test('using --name-only option', async t => {
938 const { output } = await mockOptions(t, {

Callers 1

diff.jsFile · 0.85

Calls 2

mockDiffFunction · 0.85
fileFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…