@osdk/generator 2.7.6 → 2.7.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1690,6 +1690,26 @@ describe("generator", () => {
1690
1690
  }, "", helper.minimalFiles, BASE_PATH);
1691
1691
  expect(helper.getFiles()[`${BASE_PATH}/ontology/objects.ts`]).toEqual("export {};\n");
1692
1692
  });
1693
+ it("handles value type with 0 constraints", async () => {
1694
+ const ontologyWithZeroConstraints = immer.produce(TodoWireOntology, draft => {
1695
+ draft.objectTypes.Person.objectType.properties.email.valueTypeApiName = "zeroConstraintValueType";
1696
+ draft.valueTypes["zeroConstraintValueType"] = {
1697
+ apiName: "zeroConstraintValueType",
1698
+ description: "A value type with no constraints",
1699
+ displayName: "Zero Constraint Value Type",
1700
+ rid: "ridForZeroConstraintValueType",
1701
+ version: "1.0.0",
1702
+ fieldType: {
1703
+ type: "string"
1704
+ },
1705
+ constraints: []
1706
+ };
1707
+ });
1708
+ await generateClientSdkVersionTwoPointZero(ontologyWithZeroConstraints, "typescript-sdk/0.0.0 osdk-cli/0.0.0", helper.minimalFiles, BASE_PATH);
1709
+ const personFile = helper.getFiles()[`${BASE_PATH}/ontology/objects/Person.ts`];
1710
+ expect(personFile).toBeDefined();
1711
+ expect(personFile).toContain("readonly email: $PropType['string']");
1712
+ });
1693
1713
  test.skip("runs generator locally", async () => {
1694
1714
  try {
1695
1715
  await rmdir(`${__dirname}/generated`, {