From c655eae5349a8ecc3a84f8c55f3d0d745efbe3d0 Mon Sep 17 00:00:00 2001 From: Austin DeNoble Date: Tue, 7 Nov 2023 13:52:30 -0500 Subject: [PATCH] rebase and cleanup --- src/control/__tests__/createIndex.validation.test.ts | 4 ++-- src/validator.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/control/__tests__/createIndex.validation.test.ts b/src/control/__tests__/createIndex.validation.test.ts index 60950946..d49f1007 100644 --- a/src/control/__tests__/createIndex.validation.test.ts +++ b/src/control/__tests__/createIndex.validation.test.ts @@ -180,7 +180,7 @@ describe('createIndex argument validations', () => { expect(toThrow).rejects.toThrowError(PineconeArgumentError); expect(toThrow).rejects.toThrowError( - "The argument to createIndex had type errors: property 'cloud' is a constant which must be equal to one of: 'gcp', 'aws', 'azure'." + "The argument to createIndex had type errors: property 'cloud' must be equal to one of: 'gcp', 'aws', 'azure'." ); }); @@ -196,7 +196,7 @@ describe('createIndex argument validations', () => { expect(toThrow).rejects.toThrowError(PineconeArgumentError); expect(toThrow).rejects.toThrowError( - "The argument to createIndex had type errors: property 'cloud' is a constant which must be equal to one of: 'gcp', 'aws', 'azure'." + "The argument to createIndex had type errors: property 'cloud' must be equal to one of: 'gcp', 'aws', 'azure'." ); }); diff --git a/src/validator.ts b/src/validator.ts index 25202421..9173119d 100644 --- a/src/validator.ts +++ b/src/validator.ts @@ -123,7 +123,7 @@ const typeErrors = ( const constValueErrors = propErrorGroups[property]; typeErrorsList.push( - `property '${property}' is a constant which must be equal to one of: ` + + `property '${property}' must be equal to one of: ` + Object.values(constValueErrors) .map((group) => `'${group.params.allowedValue}'`) .join(', ')