From e5023bd9cd8a71f97fe2823304dd030d32168210 Mon Sep 17 00:00:00 2001 From: kobenguyent <7845001+kobenguyent@users.noreply.github.com> Date: Mon, 10 Feb 2025 09:37:50 +0000 Subject: [PATCH 1/2] fix: add types def --- index.d.ts | 29 +++++++++++++++++++++++++++++ package.json | 1 + 2 files changed, 30 insertions(+) create mode 100644 index.d.ts diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..8fde40a --- /dev/null +++ b/index.d.ts @@ -0,0 +1,29 @@ +declare class ExpectHelper { + expectEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): void; + expectNotEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): void; + expectDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): void; + expectNotDeepEqual(actualValue: any, expectedValue: any, customErrorMsg?: string): void; + expectContain(actualValue: any, expectedValueToContain: any, customErrorMsg?: string): void; + expectNotContain(actualValue: any, expectedValueToNotContain: any, customErrorMsg?: string): void; + expectStartsWith(actualValue: string, expectedValueToStartWith: string, customErrorMsg?: string): void; + expectNotStartsWith(actualValue: string, expectedValueToNotStartWith: string, customErrorMsg?: string): void; + expectEndsWith(actualValue: string, expectedValueToEndWith: string, customErrorMsg?: string): void; + expectNotEndsWith(actualValue: string, expectedValueToNotEndWith: string, customErrorMsg?: string): void; + expectJsonSchema(targetData: any, jsonSchema: any, customErrorMsg?: string): void; + expectJsonSchemaUsingAJV(targetData: any, jsonSchema: any, customErrorMsg?: string, ajvOptions?: any): void; + expectHasProperty(targetData: any, propertyName: string, customErrorMsg?: string): void; + expectToBeA(targetData: any, type: string, customErrorMsg?: string): void; + expectToBeAn(targetData: any, type: string, customErrorMsg?: string): void; + expectMatchRegex(targetData: string, regex: RegExp, customErrorMsg?: string): void; + expectLengthOf(targetData: any, length: number, customErrorMsg?: string): void; + expectEmpty(targetData: any, customErrorMsg?: string): void; + expectTrue(targetData: any, customErrorMsg?: string): void; + expectFalse(targetData: any, customErrorMsg?: string): void; + expectAbove(targetData: number, aboveThan: number, customErrorMsg?: string): void; + expectBelow(targetData: number, belowThan: number, customErrorMsg?: string): void; + expectDeepMembers(actualValue: any[], expectedValue: any[], customErrorMsg?: string): void; + expectDeepIncludeMembers(superset: any[], set: any[], customErrorMsg?: string): void; + expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: string | string[], customErrorMsg?: string): void; + expectMatchesPattern(actualValue: object, expectedPattern: object, customErrorMsg?: string): void; + } + \ No newline at end of file diff --git a/package.json b/package.json index 5f93721..87f9deb 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "0.2.1", "description": "Expect helper for CodeceptJS", "type": "module", + "types": "index.d.ts", "main": "index.js", "scripts": { "test": "mocha index_test.js" From f8a3040e4d43cc3e5f2f0794b9b1ac682005b692 Mon Sep 17 00:00:00 2001 From: kobenguyent <7845001+kobenguyent@users.noreply.github.com> Date: Mon, 10 Feb 2025 09:41:57 +0000 Subject: [PATCH 2/2] fix: types --- index.d.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/index.d.ts b/index.d.ts index 8fde40a..f10b2d2 100644 --- a/index.d.ts +++ b/index.d.ts @@ -25,5 +25,4 @@ declare class ExpectHelper { expectDeepIncludeMembers(superset: any[], set: any[], customErrorMsg?: string): void; expectDeepEqualExcluding(actualValue: any, expectedValue: any, fieldsToExclude: string | string[], customErrorMsg?: string): void; expectMatchesPattern(actualValue: object, expectedPattern: object, customErrorMsg?: string): void; - } - \ No newline at end of file + } \ No newline at end of file