How to use expect-more - 10 common examples

To help you get started, we’ve selected a few expect-more examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github JamieMason / expect-more / packages / expect-more-jest / src / to-have-array.ts View on Github external
export const toHaveArrayMatcher = (received: any, propPath: string) =>
  createResult({
    message: () => `expected ${propPath} of ${received} to be an array`,
    notMessage: () => `expected ${propPath} of ${received} not to be an array`,
    pass: isArray(getIn(propPath.split('.'), received))
  });
github JamieMason / expect-more / packages / expect-more-jest / src / to-have-object.ts View on Github external
export const toHaveObjectMatcher = (received: any, propPath: string) =>
  createResult({
    message: () => `expected ${propPath} of ${received} to be object`,
    notMessage: () => `expected ${propPath} of ${received} not to be object`,
    pass: isObject(getIn(propPath.split('.'), received))
  });
github JamieMason / expect-more / packages / expect-more-jest / src / to-have-date-after.ts View on Github external
export const toHaveDateAfterMatcher = (received: any, propPath: string, otherDate: Date) =>
  createResult({
    message: () => `expected ${propPath} of ${received} to be date after ${otherDate}`,
    notMessage: () => `expected ${propPath} of ${received} not to be date after ${otherDate}`,
    pass: isAfter(otherDate, getIn(propPath.split('.'), received))
  });
github JamieMason / expect-more / packages / expect-more-jest / src / to-have-array-of-booleans.ts View on Github external
export const toHaveArrayOfBooleansMatcher = (received: any, propPath: string) =>
  createResult({
    message: () => `expected ${propPath} of ${received} to be an array of booleans`,
    notMessage: () => `expected ${propPath} of ${received} not to be an array of booleans`,
    pass: isArrayOfBooleans(getIn(propPath.split('.'), received))
  });
github JamieMason / expect-more / packages / expect-more-jest / src / to-have-array-of-numbers.ts View on Github external
export const toHaveArrayOfNumbersMatcher = (received: any, propPath: string) =>
  createResult({
    message: () => `expected ${propPath} of ${received} to be an array of numbers`,
    notMessage: () => `expected ${propPath} of ${received} not to be an array of numbers`,
    pass: isArrayOfNumbers(getIn(propPath.split('.'), received))
  });
github JamieMason / expect-more / packages / expect-more-jest / src / to-have-array-of-objects.ts View on Github external
export const toHaveArrayOfObjectsMatcher = (received: any, propPath: string) =>
  createResult({
    message: () => `expected ${propPath} of ${received} to be an array of objects`,
    notMessage: () => `expected ${propPath} of ${received} not to be an array of objects`,
    pass: isArrayOfObjects(getIn(propPath.split('.'), received))
  });
github JamieMason / expect-more / packages / expect-more-jest / src / to-have-array-of-size.ts View on Github external
export const toHaveArrayOfSizeMatcher = (received: any, propPath: string, size: number) =>
  createResult({
    message: () => `expected ${propPath} of ${received} to be an array containing ${size} members`,
    notMessage: () => `expected ${propPath} of ${received} not to be an array containing ${size} members`,
    pass: isArrayOfSize(size, getIn(propPath.split('.'), received))
  });
github JamieMason / expect-more / packages / expect-more-jest / src / to-have-array-of-strings.ts View on Github external
export const toHaveArrayOfStringsMatcher = (received: any, propPath: string) =>
  createResult({
    message: () => `expected ${propPath} of ${received} to be an array of strings`,
    notMessage: () => `expected ${propPath} of ${received} not to be an array of strings`,
    pass: isArrayOfStrings(getIn(propPath.split('.'), received))
  });
github JamieMason / expect-more / packages / expect-more-jest / src / to-have-date-before.ts View on Github external
export const toHaveDateBeforeMatcher = (received: any, propPath: string, otherDate: Date) =>
  createResult({
    message: () => `expected ${propPath} of ${received} to be date before ${otherDate}`,
    notMessage: () => `expected ${propPath} of ${received} not to be date before ${otherDate}`,
    pass: isBefore(otherDate, getIn(propPath.split('.'), received))
  });
github JamieMason / expect-more / packages / expect-more-jest / src / to-have-boolean.ts View on Github external
export const toHaveBooleanMatcher = (received: any, propPath: string) =>
  createResult({
    message: () => `expected ${propPath} of ${received} to be boolean`,
    notMessage: () => `expected ${propPath} of ${received} not to be boolean`,
    pass: isBoolean(getIn(propPath.split('.'), received))
  });