diff --git a/src/blocks/blockPnpmDedupe.test.ts b/src/blocks/blockPnpmDedupe.test.ts new file mode 100644 index 000000000..1c8855e3e --- /dev/null +++ b/src/blocks/blockPnpmDedupe.test.ts @@ -0,0 +1,65 @@ +import { testBlock } from "bingo-stratum-testers"; +import { describe, expect, test } from "vitest"; + +import { blockPnpmDedupe } from "./blockPnpmDedupe.js"; +import { optionsBase } from "./options.fakes.js"; + +describe("blockPnpmDedupe", () => { + test("production", () => { + const creation = testBlock(blockPnpmDedupe, { + options: optionsBase, + }); + + expect(creation).toMatchInlineSnapshot(` + { + "addons": [ + { + "addons": { + "sections": { + "Linting": { + "contents": { + "items": [ + "- \`pnpm lint:packages\` ([pnpm dedupe --check](https://pnpm.io/cli/dedupe)): Checks for unnecessarily duplicated packages in the \`pnpm-lock.yml\` file", + ], + }, + }, + }, + }, + "block": [Function], + }, + { + "addons": { + "jobs": [ + { + "name": "Lint Packages", + "steps": [ + { + "run": "pnpm lint:packages", + }, + ], + }, + ], + "removedWorkflows": [ + "lint-packages", + ], + }, + "block": [Function], + }, + { + "addons": { + "cleanupCommands": [ + "pnpm dedupe", + ], + "properties": { + "scripts": { + "lint:packages": "pnpm dedupe --check", + }, + }, + }, + "block": [Function], + }, + ], + } + `); + }); +}); diff --git a/src/blocks/blockPnpmDedupe.ts b/src/blocks/blockPnpmDedupe.ts index 9491b56bb..033f67368 100644 --- a/src/blocks/blockPnpmDedupe.ts +++ b/src/blocks/blockPnpmDedupe.ts @@ -31,7 +31,7 @@ export const blockPnpmDedupe = base.createBlock({ removedWorkflows: ["lint-packages"], }), blockPackageJson({ - cleanupCommands: ["pnpm dedupe --offline"], + cleanupCommands: ["pnpm dedupe"], properties: { scripts: { "lint:packages": "pnpm dedupe --check",