mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-03 11:37:09 +00:00
test(bundler): cover named-export globalThis registration
This commit is contained in:
1 parent
e156fbc5f6
commit
955d0a67ff
2 files changed
+57
-2
No files matched your search
@@ -34,8 +34,8 @@ export {};
|
||||
|
||||
const fakeSpec = `
|
||||
const handle = (globalThis as { __sanderling__: { extract: (g: () => unknown) => unknown } }).__sanderling__.extract(() => 42);
|
||||
(globalThis as { actions?: unknown }).actions = handle;
|
||||
export {};
|
||||
export const actionsRoot = handle;
|
||||
export const properties = "WEB_PROPS_MARKER";
|
||||
`
|
||||
|
||||
func TestBundleWeb_RegistersExpectedGlobals(t *testing.T) {
|
||||
@@ -61,6 +61,8 @@ func TestBundleWeb_RegistersExpectedGlobals(t *testing.T) {
|
||||
"__sanderlingExtractors__",
|
||||
"__sanderlingNextAction__",
|
||||
"__sanderling__",
|
||||
"WEB_PROPS_MARKER",
|
||||
"globalThis.actions",
|
||||
} {
|
||||
if !strings.Contains(source, expected) {
|
||||
t.Errorf("bundle missing %q\nsource head:\n%s", expected, head(source, 500))
|
||||
|
||||
Reference in new issue
Block a user