Skip to content

Commit

Permalink
Add test case.
Browse files Browse the repository at this point in the history
  • Loading branch information
tjprescott committed Feb 29, 2024
1 parent 5a0ca96 commit 2b2f0c8
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,3 +182,25 @@ it("does not emit diagnostic if ArmTagsProperty is used", async () => {
)
.toBeValid();
});

it("emits a diagnostic if a deeply aliased model use Record type", async () => {
await tester
.expect(
`
${nsDef}
model Foo is Bar;
model Bar is Record<unknown>;
${resource}
model WidgetProperties {
props: Foo;
}
`
)
.toEmitDiagnostics({
code: "@azure-tools/typespec-azure-resource-manager/arm-no-record",
message:
"Model properties or operation parameters should not be of type Record. ARM requires Resource provider teams to define types explicitly.",
});
});

0 comments on commit 2b2f0c8

Please sign in to comment.