-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathassertionMessageGetters.ts
More file actions
23 lines (21 loc) · 1.06 KB
/
assertionMessageGetters.ts
File metadata and controls
23 lines (21 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import {valueToString} from '../valueToString';
import type {AssertionFunctionsRecord} from './types';
/**
* Assertion message getters.
* @internal
*/
export const assertionMessageGetters: AssertionFunctionsRecord<string> = {
contains: (expected) => `contains ${valueToString(expected)}`,
eql: (expected) => `is deeply equal to ${valueToString(expected)}`,
gt: (expected) => `is strictly greater than ${valueToString(expected)}`,
gte: (expected) => `is greater than or equal to ${valueToString(expected)}`,
lt: (expected) => `is less than ${valueToString(expected)}`,
lte: (expected) => `is less than or equal to ${valueToString(expected)}`,
match: (re) => `matches the regular expression ${valueToString(re)}`,
notContains: (unexpected) => `not contains ${valueToString(unexpected)}`,
notEql: (unexpected) => `is not deeply equal to ${valueToString(unexpected)}`,
notOk: () => 'is falsy',
ok: () => 'is truthy',
toBeInViewport: () => 'intersects viewport',
toMatchScreenshot: (expected) => `matches the expected screenshot ${valueToString(expected)}`,
};