aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/test/jest.classes.ts
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-11-07 00:53:24 -0800
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-11-07 00:53:24 -0800
commit71d0e14210fb0fa1cd19c650dfd45e25dcafab98 (patch)
tree75e935f6e9859d058005672c2529bc9777245af8 /src/bun.js/test/jest.classes.ts
parentd925367cae1f22ad85a29ae02456286d9ccc859a (diff)
downloadbun-71d0e14210fb0fa1cd19c650dfd45e25dcafab98.tar.gz
bun-71d0e14210fb0fa1cd19c650dfd45e25dcafab98.tar.zst
bun-71d0e14210fb0fa1cd19c650dfd45e25dcafab98.zip
[bun:test] Implement `expect` in faster Zig bindings
Diffstat (limited to 'src/bun.js/test/jest.classes.ts')
-rw-r--r--src/bun.js/test/jest.classes.ts186
1 files changed, 186 insertions, 0 deletions
diff --git a/src/bun.js/test/jest.classes.ts b/src/bun.js/test/jest.classes.ts
new file mode 100644
index 000000000..06a5232fc
--- /dev/null
+++ b/src/bun.js/test/jest.classes.ts
@@ -0,0 +1,186 @@
+import { define } from "../scripts/class-definitions";
+
+export default [
+ define({
+ name: "Expect",
+ construct: true,
+ call: true,
+ finalize: true,
+ JSType: "0b11101110",
+ values: ["capturedValue", "resultValue"],
+ klass: {
+ extend: {
+ fn: "extend",
+ length: 1,
+ },
+ anything: {
+ fn: "anything",
+ length: 1,
+ },
+ any: {
+ fn: "any",
+ length: 1,
+ },
+ arrayContaining: {
+ fn: "arrayContaining",
+ length: 1,
+ },
+ assertions: {
+ fn: "assertions",
+ length: 1,
+ },
+ hasAssertions: {
+ fn: "hasAssertions",
+ length: 1,
+ },
+ objectContaining: {
+ fn: "objectContaining",
+ length: 1,
+ },
+ stringContaining: {
+ fn: "stringContaining",
+ length: 1,
+ },
+ stringMatching: {
+ fn: "stringMatching",
+ length: 1,
+ },
+ addSnapshotSerializer: {
+ fn: "addSnapshotSerializer",
+ length: 1,
+ },
+ not: {
+ getter: "getStaticNot",
+ },
+ resolves: {
+ getter: "getStaticResolves",
+ },
+ rejects: {
+ getter: "getStaticRejects",
+ },
+ },
+ proto: {
+ toBe: {
+ fn: "toBe",
+ length: 1,
+ },
+ toHaveBeenCalledTimes: {
+ fn: "toHaveBeenCalledTimes",
+ length: 1,
+ },
+ toHaveBeenCalledWith: {
+ fn: "toHaveBeenCalledWith",
+ length: 1,
+ },
+ toHaveBeenLastCalledWith: {
+ fn: "toHaveBeenLastCalledWith",
+ length: 1,
+ },
+ toHaveBeenNthCalledWith: {
+ fn: "toHaveBeenNthCalledWith",
+ length: 1,
+ },
+ toHaveReturnedTimes: {
+ fn: "toHaveReturnedTimes",
+ length: 1,
+ },
+ toHaveReturnedWith: {
+ fn: "toHaveReturnedWith",
+ length: 1,
+ },
+ toHaveLastReturnedWith: {
+ fn: "toHaveLastReturnedWith",
+ length: 1,
+ },
+ toHaveNthReturnedWith: {
+ fn: "toHaveNthReturnedWith",
+ length: 1,
+ },
+ toHaveLength: {
+ fn: "toHaveLength",
+ length: 1,
+ },
+ toHaveProperty: {
+ fn: "toHaveProperty",
+ length: 1,
+ },
+ toBeCloseTo: {
+ fn: "toBeCloseTo",
+ length: 1,
+ },
+ toBeGreaterThan: {
+ fn: "toBeGreaterThan",
+ length: 1,
+ },
+ toBeGreaterThanOrEqual: {
+ fn: "toBeGreaterThanOrEqual",
+ length: 1,
+ },
+ toBeLessThan: {
+ fn: "toBeLessThan",
+ length: 1,
+ },
+ toBeLessThanOrEqual: {
+ fn: "toBeLessThanOrEqual",
+ length: 1,
+ },
+ toBeInstanceOf: {
+ fn: "toBeInstanceOf",
+ length: 1,
+ },
+ toContain: {
+ fn: "toContain",
+ length: 1,
+ },
+ toContainEqual: {
+ fn: "toContainEqual",
+ length: 1,
+ },
+ toEqual: {
+ fn: "toEqual",
+ length: 1,
+ },
+ toMatch: {
+ fn: "toMatch",
+ length: 1,
+ },
+ toMatchObject: {
+ fn: "toMatchObject",
+ length: 1,
+ },
+ toMatchSnapshot: {
+ fn: "toMatchSnapshot",
+ length: 1,
+ },
+ toMatchInlineSnapshot: {
+ fn: "toMatchInlineSnapshot",
+ length: 1,
+ },
+ toStrictEqual: {
+ fn: "toStrictEqual",
+ length: 1,
+ },
+ toThrow: {
+ fn: "toThrow",
+ length: 1,
+ },
+ toThrowErrorMatchingSnapshot: {
+ fn: "toThrowErrorMatchingSnapshot",
+ length: 1,
+ },
+ toThrowErrorMatchingInlineSnapshot: {
+ fn: "toThrowErrorMatchingInlineSnapshot",
+ length: 1,
+ },
+ not: {
+ getter: "getNot",
+ },
+ resolves: {
+ getter: "getResolves",
+ },
+ rejects: {
+ getter: "getRejects",
+ },
+ },
+ }),
+];