@dreamboard-games/testing 0.1.2 → 0.1.3

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.
package/dist/index.d.ts CHANGED
@@ -29,6 +29,7 @@ type ExpectMatchers = {
29
29
  toContain: (expected: unknown) => void;
30
30
  toContainEqual: (expected: unknown) => void;
31
31
  toHaveLength: (expected: number) => void;
32
+ toBeGreaterThan: (expected: number) => void;
32
33
  toBeGreaterThanOrEqual: (expected: number) => void;
33
34
  toThrow: (predicate?: string | RegExp | ((error: Error) => boolean)) => void;
34
35
  toMatchSnapshot: (filename?: string) => void;
package/dist/index.js CHANGED
@@ -190,6 +190,14 @@ function createExpectApi(options = {}) {
190
190
  toHaveLength: (expected) => {
191
191
  assertLength(actual, expected);
192
192
  },
193
+ toBeGreaterThan: (expected) => {
194
+ if (typeof actual !== "number") {
195
+ throw new Error("toBeGreaterThan expects a number actual value.");
196
+ }
197
+ if (actual <= expected) {
198
+ throw new Error(`Expected ${actual} to be > ${expected}.`);
199
+ }
200
+ },
193
201
  toBeGreaterThanOrEqual: (expected) => {
194
202
  if (typeof actual !== "number") {
195
203
  throw new Error(