mirror of
https://github.com/github/awesome-copilot.git
synced 2026-08-09 02:29:13 +00:00
ec705989e3
Accept reusable canvas sources that are referenced by an existing parent plugin, matching the post-#2546 scaffolding guidance, while continuing to reject orphaned sources. Cover parent-only, standalone, and orphaned registrations. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 52be9c67-3ae4-4610-93d0-fe0b7ab95ccb
37 lines
816 B
JavaScript
37 lines
816 B
JavaScript
import assert from "node:assert/strict";
|
|
import { test } from "node:test";
|
|
import { isReusableExtensionRegistered } from "./validate-plugins.mjs";
|
|
|
|
test("accepts a reusable extension bundled only by a parent plugin", () => {
|
|
assert.equal(
|
|
isReusableExtensionRegistered(
|
|
"daily-focus-board",
|
|
new Set(["ember"]),
|
|
new Set(["daily-focus-board"])
|
|
),
|
|
true
|
|
);
|
|
});
|
|
|
|
test("accepts a same-named standalone extension plugin", () => {
|
|
assert.equal(
|
|
isReusableExtensionRegistered(
|
|
"daily-focus-board",
|
|
new Set(["daily-focus-board"]),
|
|
new Set()
|
|
),
|
|
true
|
|
);
|
|
});
|
|
|
|
test("rejects an orphaned reusable extension", () => {
|
|
assert.equal(
|
|
isReusableExtensionRegistered(
|
|
"daily-focus-board",
|
|
new Set(["ember"]),
|
|
new Set()
|
|
),
|
|
false
|
|
);
|
|
});
|