-
Notifications
You must be signed in to change notification settings - Fork 1
Description
I would like to propose adding the following new assertions to the test runner. These assertions will expand its functionality, make it more versatile, and align with modern testing frameworks. Below is the list of proposed assertions along with a brief description of each:
-
1.
.toBeType()Validates the type of a value, for example, whether it's a
string,object,number, etc. -
2.
.toBeInstanceOf()Checks if an object is an instance of a specific class.
-
3.
.toResolve()Ensures that a promise resolves successfully.
-
4.
.toReject()Ensures that a promise is rejected with an error.
-
5.
.toDeepEqual()Performs deep equality comparison of objects or arrays (useful for testing nested structures).
-
6.
.toBeSorted()Validates that an array is sorted either in ascending or descending order.
-
7.
.toBeUnique()Confirms that all elements in an array are unique (no duplicates).
-
8.
.toRespondWithStatus()Verifies that an HTTP response has the expected status code.
-
9.
.toHaveJSONBody()Validates that an HTTP response body contains valid JSON and optionally verifies its structure.