UNPKG

flagpole

Version:

Simple and fast DOM integration, headless or headful browser, and REST API testing framework.

78 lines (77 loc) 3 kB
/// <reference types="node" /> import { AssertionResult } from "./logging/assertionresult"; import { iAssertionContext, iAssertion, IteratorCallback } from "./interfaces"; import { iValue } from "."; export declare class Assertion implements iAssertion { get and(): Assertion; get type(): Assertion; get length(): Assertion; get keys(): Assertion; get values(): Assertion; get not(): Assertion; get optional(): Assertion; get result(): Promise<AssertionResult | null>; get assertionMade(): boolean; get isFinalized(): boolean; get name(): string; get passed(): boolean | null; private _context; private _ajv; private _input; private _message; private _not; private _optional; private _result; private _finishedPromise; private _finishedResolver; private _statement; private _assertionMade; private _defaultMessages; static create(context: iAssertionContext, thisValue: any, message?: string): Promise<Assertion>; constructor(context: iAssertionContext, thisValue: any, message?: string | null); exactly(value: any): Assertion; equals(value: any): Assertion; like(value: any): Assertion; greaterThan(value: any): Assertion; greaterThanOrEquals(value: any): Assertion; lessThan(value: any): Assertion; lessThanOrEquals(value: any): Assertion; between(min: any, max: any): Assertion; matches(value: any): Assertion; contains(value: any): Assertion; looksLike(imageData: Buffer): Assertion; looksLike(imageLocalPath: string): Assertion; looksLike(imageData: Buffer, threshold: number): Assertion; looksLike(imageLocalPath: string, threshold: number): Assertion; looksLike(imageData: Buffer, thresholdPercent: string): Assertion; looksLike(imageLocalPath: string, thresholdPercent: string): Assertion; startsWith(value: any): Assertion; endsWith(value: any): Assertion; in(values: any[]): Assertion; includes(value: any): Assertion; exists(): Assertion; resolves(continueOnReject?: boolean): Promise<Assertion>; rejects(continueOnReject?: boolean): Promise<any>; none(callback: IteratorCallback): Promise<Assertion>; every(callback: IteratorCallback): Promise<Assertion>; everySync(callback: IteratorCallback): Assertion; some(callback: IteratorCallback): Promise<Assertion>; schema(schema: any, simple?: boolean): Promise<Assertion>; assert(message: string, value: any): Assertion; assert(value: any): Assertion; comment(value: iValue): iAssertion; comment(message: string): iAssertion; as(aliasName: string): iAssertion; private _loadSchemaValidator; private _returnsPromise; private _getMessage; private _getSourceCode; private _getHighlightText; private _getActualValueText; private _evalulate; private _getCompareValue; private _getName; private _getSubject; private _resolveAssertion; private _setDefaultMessages; }