Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(world): add namespaceLabel to system config #3057

Merged
merged 11 commits into from
Aug 23, 2024
Prev Previous commit
Next Next commit
copypasta
  • Loading branch information
holic committed Aug 22, 2024
commit 209521e47fed46b47039d3f4baa0644f7fb56ac2
24 changes: 12 additions & 12 deletions packages/world/ts/config/v2/world.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -671,39 +671,39 @@ describe("defineWorld", () => {
defineWorld({
systems: {
Example: {
// @ts-expect-error "Overrides of `label`, `namespaceLabel`, and `namespace` are not allowed for tables in this context"
// @ts-expect-error "Overrides of `label`, `namespaceLabel`, and `namespace` are not allowed for systems in this context"
label: "",
},
},
}),
).throwsAndHasTypeError(
"Overrides of `label`, `namespaceLabel`, and `namespace` are not allowed for tables in this context",
"Overrides of `label`, `namespaceLabel`, and `namespace` are not allowed for systems in this context",
);

attest(() =>
defineWorld({
systems: {
Example: {
// @ts-expect-error "Overrides of `label`, `namespaceLabel`, and `namespace` are not allowed for tables in this context"
// @ts-expect-error "Overrides of `label`, `namespaceLabel`, and `namespace` are not allowed for systems in this context"
namespaceLabel: "",
},
},
}),
).throwsAndHasTypeError(
"Overrides of `label`, `namespaceLabel`, and `namespace` are not allowed for tables in this context",
"Overrides of `label`, `namespaceLabel`, and `namespace` are not allowed for systems in this context",
);

attest(() =>
defineWorld({
systems: {
Example: {
// @ts-expect-error "Overrides of `label`, `namespaceLabel`, and `namespace` are not allowed for tables in this context"
// @ts-expect-error "Overrides of `label`, `namespaceLabel`, and `namespace` are not allowed for systems in this context"
namespace: "",
},
},
}),
).throwsAndHasTypeError(
"Overrides of `label`, `namespaceLabel`, and `namespace` are not allowed for tables in this context",
"Overrides of `label`, `namespaceLabel`, and `namespace` are not allowed for systems in this context",
);

attest(() =>
Expand All @@ -712,15 +712,15 @@ describe("defineWorld", () => {
CustomNS: {
systems: {
Example: {
// @ts-expect-error "Overrides of `label`, `namespaceLabel`, and `namespace` are not allowed for tables in this context"
// @ts-expect-error "Overrides of `label`, `namespaceLabel`, and `namespace` are not allowed for systems in this context"
label: "",
},
},
},
},
}),
).throwsAndHasTypeError(
"Overrides of `label`, `namespaceLabel`, and `namespace` are not allowed for tables in this context",
"Overrides of `label`, `namespaceLabel`, and `namespace` are not allowed for systems in this context",
);

attest(() =>
Expand All @@ -729,15 +729,15 @@ describe("defineWorld", () => {
CustomNS: {
systems: {
Example: {
// @ts-expect-error "Overrides of `label`, `namespaceLabel`, and `namespace` are not allowed for tables in this context"
// @ts-expect-error "Overrides of `label`, `namespaceLabel`, and `namespace` are not allowed for systems in this context"
namespaceLabel: "",
},
},
},
},
}),
).throwsAndHasTypeError(
"Overrides of `label`, `namespaceLabel`, and `namespace` are not allowed for tables in this context",
"Overrides of `label`, `namespaceLabel`, and `namespace` are not allowed for systems in this context",
);

attest(() =>
Expand All @@ -746,15 +746,15 @@ describe("defineWorld", () => {
CustomNS: {
systems: {
Example: {
// @ts-expect-error "Overrides of `label`, `namespaceLabel`, and `namespace` are not allowed for tables in this context"
// @ts-expect-error "Overrides of `label`, `namespaceLabel`, and `namespace` are not allowed for systems in this context"
namespace: "",
},
},
},
},
}),
).throwsAndHasTypeError(
"Overrides of `label`, `namespaceLabel`, and `namespace` are not allowed for tables in this context",
"Overrides of `label`, `namespaceLabel`, and `namespace` are not allowed for systems in this context",
);
});

Expand Down
Loading