Close the re-export bypass in the helpers freeze ratchet
The declaration counter does not see `export { x } from "./y.js"` or
`export *`, so a re-export would re-publish helpers from this file's
namespace without touching either ceiling. Assert against that syntax.
This commit is contained in:
1 parent
19c8dd3146
commit
0de2db14ae
1 file changed
+7
@@ -56,6 +56,13 @@ describe("capabilities/helpers.ts freeze", () => {
|
||||
expect(source).toContain("helpers.freeze.test.ts");
|
||||
});
|
||||
|
||||
test("no re-export syntax sneaks new symbols into the namespace", () => {
|
||||
// The declaration counter above does not see `export { x } from "..."` or
|
||||
// `export *`, which would re-publish helpers from this file's namespace
|
||||
// without touching either ceiling.
|
||||
expect(source).not.toMatch(/^export\s*(\{|\*)/m);
|
||||
});
|
||||
|
||||
test("measures what it claims to measure", () => {
|
||||
// Guard the ratchet itself: a pattern that matches nothing would silently
|
||||
// pin the export ceiling at 0 and pass forever.
|
||||
|
||||
Reference in new issue
Block a user