@olton/latte
Version:
Simple test framework for JavaScript and TypeScript with DOM supports
437 lines (426 loc) • 12.4 kB
JavaScript
export default {
toBeEmpty: {
positive: 'Array is not empty',
negative: 'Array is empty'
},
hasLength: {
positive: 'Array has length different from expected',
negative: 'Array has expected length'
},
toBeArrayUnique: {
positive: 'Array has duplicates',
negative: 'Array is unique'
},
toBeArraySorted: {
positive: 'Array is not sorted',
negative: 'Array is sorted'
},
toContain: {
positive: 'Array does not contain expected value',
negative: 'Array contains expected value'
},
toBeArrayEqual: {
positive: 'Arrays are not equal',
negative: 'Arrays are equal'
},
toBeArray: {
positive: 'Value is not an array',
negative: 'Value is an array'
},
toBeResolvedWith: {
positive: 'Promise was not resolved with expected value',
negative: 'Promise was resolved with expected value'
},
toBeRejectedWith: {
positive: 'Promise was not rejected with expected value',
negative: 'Promise was rejected with expected value'
},
toBe: {
positive: 'Values are not equal',
negative: 'Values are equal'
},
toBeStrictEqual: {
positive: 'Values are not strictly equal',
negative: 'Values are strictly equal'
},
toBeEqual: {
positive: 'Values are not equal',
negative: 'Values are equal'
},
toBeHEXColor: {
positive: 'Value is not a valid HEX color',
negative: 'Value is a valid HEX color'
},
toBeRGBColor: {
positive: 'Value is not a valid RGB color',
negative: 'Value is a valid RGB color'
},
toBeRGBAColor: {
positive: 'Value is not a valid RGBA color',
negative: 'Value is a valid RGBA color'
},
toBeHSLColor: {
positive: 'Value is not a valid HSL color',
negative: 'Value is a valid HSL color'
},
toBeHSLAColor: {
positive: 'Value is not a valid HSLA color',
negative: 'Value is a valid HSLA color'
},
toBeCMYKColor: {
positive: 'Value is not a valid CMYK color',
negative: 'Value is a valid CMYK color'
},
toBeColor: {
positive: 'Value is not a valid color',
negative: 'Value is a valid color'
},
toBeHTMLElement: {
positive: 'Value is not a HTMLElement',
negative: 'Value is a HTMLElement'
},
toBeNode: {
positive: 'Value is not a Node element',
negative: 'Value is a Node'
},
toBeDocument: {
positive: 'Value is not a Document element',
negative: 'Value is a Document'
},
toBeHTMLCollection: {
positive: 'Value is not a valid HTMLCollection',
negative: 'Value is a valid HTMLCollection'
},
toBeWindow: {
positive: 'Value is not a Window element',
negative: 'Value is a Window'
},
toBeTextNode: {
positive: 'Value is not a TextNode element',
negative: 'Value is a TextNode'
},
hasClass: {
positive: 'Element does not have expected class',
negative: 'Element has expected class'
},
hasAttribute: {
positive: 'Element does not have expected attribute',
negative: 'Element has expected attribute'
},
hasChildren: {
positive: 'Element does not have children',
negative: 'Element has children'
},
hasParent: {
positive: 'Element does not have parent',
negative: 'Element has parent'
},
hasStyle: {
positive: 'Element does not have expected style',
negative: 'Element has expected style'
},
hasStyleProperty: {
positive: 'Element does not have expected style property',
negative: 'Element has expected style property'
},
hasStyles: {
positive: 'Element does not have expected styles',
negative: 'Element has expected styles'
},
hasSiblings: {
positive: 'Element does not have siblings',
negative: 'Element has siblings'
},
hasSibling: {
positive: 'Element does not have expected sibling',
negative: 'Element has expected sibling'
},
hasPrev: {
positive: 'Element does not have previous sibling',
negative: 'Element has previous sibling'
},
hasNext: {
positive: 'Element does not have next sibling',
negative: 'Element has next sibling'
},
hasText: {
positive: 'Element does not have expected text',
negative: 'Element has expected text'
},
containsElement: {
positive: 'Element does not contain expected element',
negative: 'Element contains expected element'
},
containsElementDeep: {
positive: 'Element does not contain expected element deeply',
negative: 'Element contains expected element deeply'
},
hasId: {
positive: 'Element does not have expected id',
negative: 'Element has expected id'
},
hasHref: {
positive: 'Element does not have expected href',
negative: 'Element has expected href'
},
hasName: {
positive: 'Element does not have expected name',
negative: 'Element has expected name'
},
hasSrc: {
positive: 'Element does not have expected src',
negative: 'Element has expected src'
},
toHaveBeenCalled: {
positive: 'Function was not called',
negative: 'Function was called'
},
toHaveBeenCalledTimes: {
positive: 'Function was not called expected times',
negative: 'Function was called expected times'
},
toHaveBeenCalledWith: {
positive: 'Function was not called with expected arguments',
negative: 'Function was called with expected arguments'
},
toHaveBeenLastCalledWith: {
positive: 'Function was not last called with expected arguments',
negative: 'Function was last called with expected arguments'
},
toBeObject: {
positive: 'Value is not an object',
negative: 'Value is an object'
},
toBeDeepEqual: {
positive: 'Objects are not deeply equal',
negative: 'Objects are deeply equal'
},
toBeDeepEqualSafe: {
positive: 'Objects are not deeply equal (safe)',
negative: 'Objects are deeply equal (safe)'
},
toBeObjectStructureEqual: {
positive: 'Objects are not equal by structure',
negative: 'Objects are equal by structure'
},
hasProperty: {
positive: 'Object does not have expected property',
negative: 'Object has expected property'
},
toThrow: {
positive: 'Function did not throw expected error',
negative: 'Function threw expected error'
},
toThrowError: {
positive: 'Function did not throw expected error',
negative: 'Function threw expected error'
},
toBeBoolean: {
positive: 'Value is not a boolean',
negative: 'Value is a boolean'
},
toBeDefined: {
positive: 'Value is not defined',
negative: 'Value is defined'
},
toBeUndefined: {
positive: 'Value is defined',
negative: 'Value is undefined'
},
toBeNull: {
positive: 'Value is not null',
negative: 'Value is null'
},
toBeInteger: {
positive: 'Value is not an integer',
negative: 'Value is an integer'
},
toBeSafeInteger: {
positive: 'Value is not a safe integer',
negative: 'Value is a safe integer'
},
toBeFloat: {
positive: 'Value is not a float',
negative: 'Value is a float'
},
toBeNumber: {
positive: 'Value is not a number',
negative: 'Value is a number'
},
toBeNaN: {
positive: 'Value is not NaN',
negative: 'Value is NaN'
},
toBeJson: {
positive: 'Value is not a valid JSON',
negative: 'Value is a valid JSON'
},
toBeXml: {
positive: 'Value is not a valid XML',
negative: 'Value is a valid XML'
},
toBeType: {
positive: 'Value is not of expected type',
negative: 'Value is of expected type'
},
toBeInstanceOf: {
positive: 'Value is not an instance of expected class',
negative: 'Value is an instance of expected class'
},
toBeString: {
positive: 'Value is not a string',
negative: 'Value is a string'
},
toBeFunction: {
positive: 'Value is not a function',
negative: 'Value is a function'
},
toBeAsyncFunction: {
positive: 'Value is not an async function',
negative: 'Value is an async function'
},
toBeDate: {
positive: 'Value is not a date',
negative: 'Value is a date'
},
toBeDateObject: {
positive: 'Value is not a date object',
negative: 'Value is a date object'
},
toBeRegExp: {
positive: 'Value is not a regular expression',
negative: 'Value is a regular expression'
},
toBeSymbol: {
positive: 'Value is not a symbol',
negative: 'Value is a symbol'
},
toBeBigInt: {
positive: 'Value is not a BigInt',
negative: 'Value is a BigInt'
},
toBeMap: {
positive: 'Value is not a Map',
negative: 'Value is a Map'
},
toBeSet: {
positive: 'Value is not a Set',
negative: 'Value is a Set'
},
toBeWeakMap: {
positive: 'Value is not a WeakMap',
negative: 'Value is a WeakMap'
},
toBeWeakSet: {
positive: 'Value is not a WeakSet',
negative: 'Value is a WeakSet'
},
toBeArrayBuffer: {
positive: 'Value is not an ArrayBuffer',
negative: 'Value is an ArrayBuffer'
},
toBePromise: {
positive: 'Value is not a Promise',
negative: 'Value is a Promise'
},
toBeTrue: {
positive: 'Value is not true',
negative: 'Value is true'
},
toBeFalse: {
positive: 'Value is not false',
negative: 'Value is false'
},
toMatch: {
positive: 'Value does not match expected pattern',
negative: 'Value matches expected pattern'
},
toBeGreaterThan: {
positive: 'Value is not greater than expected value',
negative: 'Value is greater than expected value'
},
toBeGreaterThanOrEqual: {
positive: 'Value is not greater than or equal to expected value',
negative: 'Value is greater than or equal to expected value'
},
toBeLessThan: {
positive: 'Value is not less than expected value',
negative: 'Value is less than expected value'
},
toBeLessThanOrEqual: {
positive: 'Value is not less than or equal to expected value',
negative: 'Value is less than or equal to expected value'
},
toBetween: {
positive: 'Value is not between expected values',
negative: 'Value is between expected values'
},
toBePositive: {
positive: 'Value is not positive',
negative: 'Value is positive'
},
toBeNegative: {
positive: 'Value is not negative',
negative: 'Value is negative'
},
toBeFinite: {
positive: 'Value is not finite',
negative: 'Value is finite'
},
toBeCloseTo: {
positive: 'Value is not close to expected value',
negative: 'Value is close to expected value'
},
toBeIP: {
positive: 'Value is not a valid IP address',
negative: 'Value is a valid IP address'
},
toBeIPv4: {
positive: 'Value is not a valid IPv4 address',
negative: 'Value is a valid IPv4 address'
},
toBeIPv6: {
positive: 'Value is not a valid IPv6 address',
negative: 'Value is a valid IPv6 address'
},
toBeEmail: {
positive: 'Value is not a valid email address',
negative: 'Value is a valid email address'
},
toBeURL: {
positive: 'Value is not a valid URL',
negative: 'Value is a valid URL'
},
toBeBase64: {
positive: 'Value is not a valid Base64 string',
negative: 'Value is a valid Base64 string'
},
hasAriaAttributes: {
positive: 'Element does not have expected aria attributes',
negative: 'Element has expected aria attributes'
},
hasAriaAttribute: {
positive: 'Element does not have expected aria attribute',
negative: 'Element has expected aria attribute'
},
hasAriaRole: {
positive: 'Element does not have expected aria role',
negative: 'Element has expected aria role'
},
hasAriaLabel: {
positive: 'Element does not have expected aria label',
negative: 'Element has expected aria label'
},
hasAltText: {
positive: 'Element does not have expected alt text',
negative: 'Element has expected alt text'
},
toBeKeyboardAccessible: {
positive: 'Element is not keyboard accessible',
negative: 'Element is keyboard accessible'
},
any: {
positive: 'Element does not have expected any',
negative: 'Element has expected any'
},
}