diff --git a/packages/docs/sidebars.ts b/packages/docs/sidebars.ts index 8ec728bd..83e417e7 100644 --- a/packages/docs/sidebars.ts +++ b/packages/docs/sidebars.ts @@ -36,8 +36,8 @@ const sidebars: SidebarsConfig = { "guides/configuring-nadle", "guides/eslint-plugin", { - label: "Migrating", type: "category", + label: "Migrating", items: [ "guides/migrating/from-npm-scripts", "guides/migrating/from-turborepo", diff --git a/packages/nadle/test/errors.test.ts b/packages/nadle/test/errors.test.ts index 52c70cf5..3cacc473 100644 --- a/packages/nadle/test/errors.test.ts +++ b/packages/nadle/test/errors.test.ts @@ -1,5 +1,5 @@ import { it, expect, describe } from "vitest"; -import { exec, fixture, readConfig, expectFail, withGeneratedFixture } from "setup"; +import { exec, fixture, readConfig, expectFail, withFixture, workspaceFixture, withGeneratedFixture } from "setup"; const duplicateTasksFiles = fixture() .packageJson("duplicate-tasks") @@ -15,10 +15,19 @@ describe("when register two tasks with the same name", () => { } })); - // TODO(#416): mirror the root-workspace duplicate-task case above for a - // sub-workspace — register the same task name twice inside a package of a - // monorepo fixture and assert "Task already registered in workspace ". - it.todo("should throw error within workspace"); + it("should throw error within workspace", () => + withFixture({ + fixtureDir: "monorepo", + testFn: async ({ exec }) => { + await expect(() => exec`build`).rejects.toThrow(`Task hello already registered in workspace packages:one`); + }, + files: workspaceFixture({ + root: { tasks: [{ name: "build" }] }, + workspaces: { + "packages/one": { rawConfig: 'import { tasks } from "nadle";\n\ntasks.register("hello");\ntasks.register("hello");\n' } + } + }) + })); }); describe("when a task fails", () => { diff --git a/packages/nadle/test/features/workspaces/workspaces-alias.test.ts b/packages/nadle/test/features/workspaces/workspaces-alias.test.ts index 5de8326e..2945cc62 100644 --- a/packages/nadle/test/features/workspaces/workspaces-alias.test.ts +++ b/packages/nadle/test/features/workspaces/workspaces-alias.test.ts @@ -58,8 +58,9 @@ describe("workspaces alias", () => { }); }); - // TODO(#416): assert alias validation rejects invalid configs — duplicate - // aliases mapping to different workspaces, an alias colliding with a real - // workspace id, and an alias for a non-existent path should each error. + // TODO(#698): blocked on alias validation not existing yet. Once #698 adds + // semantic validation, assert it rejects invalid configs — duplicate aliases + // mapping to different workspaces, an alias colliding with a real workspace id, + // and an alias for a non-existent path should each error. it.todo("rejects invalid alias configuration"); }); diff --git a/packages/nadle/test/features/workspaces/workspaces-detection.test.ts b/packages/nadle/test/features/workspaces/workspaces-detection.test.ts index e1329598..a9cef740 100644 --- a/packages/nadle/test/features/workspaces/workspaces-detection.test.ts +++ b/packages/nadle/test/features/workspaces/workspaces-detection.test.ts @@ -3,9 +3,10 @@ import { PACKAGE_JSON } from "@nadle/project-resolver"; import { expectPass, withFixture, CONFIG_FILE, PNPM_WORKSPACE, createPackageJson, createPnpmWorkspace } from "setup"; describe("workspaces detection", () => { - // TODO(#416): a monorepo whose pnpm-workspace matches exactly one package - // currently errors during detection. Decide the intended behavior (treat as - // a valid single-workspace monorepo vs. a clear error message) and assert it. + // TODO(#699): blocked on a behavior decision. A monorepo whose pnpm-workspace + // matches exactly one package currently errors during detection. Once #699 + // settles the intended behavior (valid single-workspace monorepo vs. a clear + // error message), assert it. it.todo("single workspace in monorepo"); it("one package", async () => {