Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/docs/sidebars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
19 changes: 14 additions & 5 deletions packages/nadle/test/errors.test.ts
Original file line number Diff line number Diff line change
@@ -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")
Expand All @@ -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 <name> already registered in workspace <id>".
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", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
});
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down
Loading