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

Function mockWorkspaces

deps/npm/test/lib/commands/pkg.js:601–626  ·  view source on GitHub ↗
(t)

Source from the content-addressed store, hash-verified

599
600t.test('workspaces', async t => {
601 const mockWorkspaces = (t) => mockNpm(t, {
602 prefixDir: {
603 'package.json': JSON.stringify({
604 name: 'root',
605 version: '1.0.0',
606 workspaces: [
607 'packages/*',
608 ],
609 }),
610 packages: {
611 a: {
612 'package.json': JSON.stringify({
613 name: 'a',
614 version: '1.0.0',
615 }),
616 },
617 b: {
618 'package.json': JSON.stringify({
619 name: 'b',
620 version: '1.2.3',
621 }),
622 },
623 },
624 },
625 config: { workspaces: true },
626 })
627
628 t.test('get', async t => {
629 const { pkg, OUTPUT } = await mockWorkspaces(t)

Callers 1

pkg.jsFile · 0.70

Calls 1

mockNpmFunction · 0.70

Tested by

no test coverage detected