Pular para o conteúdo

Interface: ChaiExpect

Definido em: fp-api.d.ts:337

Fluent, chai-compatible assertion builder returned by fp.expect(value).

All terminal calls throw AssertionError on failure — typical usage is inside fp.test(name, () => { fp.expect(…).to.equal(…) }).

readonly and: ChaiExpect;

Definido em: fp-api.d.ts:352

Connective chain word.


readonly at: ChaiExpect;

Definido em: fp-api.d.ts:360

Connective chain word.


readonly be: ChaiExpect;

Definido em: fp-api.d.ts:342

Connective chain word.


readonly been: ChaiExpect;

Definido em: fp-api.d.ts:344

Connective chain word.


contain: ChaiIncludeTerminal;

Definido em: fp-api.d.ts:427

Alias of ChaiExpect.include.


readonly deep: ChaiExpect;

Definido em: fp-api.d.ts:367

Switch subsequent equal into deep-structural equality.


readonly empty: void;

Definido em: fp-api.d.ts:389

Assert target is an empty string, array or object.


readonly exist: void;

Definido em: fp-api.d.ts:377

Assert target is neither null nor undefined.


readonly false: void;

Definido em: fp-api.d.ts:383

Assert target is strictly false.


readonly has: ChaiExpect;

Definido em: fp-api.d.ts:354

Connective chain word.


readonly have: ChaiExpect;

Definido em: fp-api.d.ts:356

Connective chain word.


include: ChaiIncludeTerminal;

Definido em: fp-api.d.ts:425

Containment check (string substring, array member, or object subset).


readonly is: ChaiExpect;

Definido em: fp-api.d.ts:346

Connective chain word.


readonly nested: ChaiExpect;

Definido em: fp-api.d.ts:370

Switch subsequent property() to dotted-path resolution.


readonly not: ChaiExpect;

Definido em: fp-api.d.ts:373

Negate the next assertion.


readonly null: void;

Definido em: fp-api.d.ts:385

Assert target is strictly null.


readonly of: ChaiExpect;

Definido em: fp-api.d.ts:362

Connective chain word.


readonly ok: void;

Definido em: fp-api.d.ts:379

Assert target is truthy.


readonly same: ChaiExpect;

Definido em: fp-api.d.ts:364

Connective chain word.


readonly that: ChaiExpect;

Definido em: fp-api.d.ts:348

Connective chain word.


readonly to: ChaiExpect;

Definido em: fp-api.d.ts:340

Connective chain word.


readonly true: void;

Definido em: fp-api.d.ts:381

Assert target is strictly true.


readonly undefined: void;

Definido em: fp-api.d.ts:387

Assert target is strictly undefined.


readonly which: ChaiExpect;

Definido em: fp-api.d.ts:350

Connective chain word.


readonly with: ChaiExpect;

Definido em: fp-api.d.ts:358

Connective chain word.

a(type): void;

Definido em: fp-api.d.ts:408

Assert typeof target matches the given name ("string", "number", "object", "array", "null", …).

ParameterTipo
typestring

void


above(n): void;

Definido em: fp-api.d.ts:434

Assert target > n.

ParameterTipo
nnumber

void


an(type): void;

Definido em: fp-api.d.ts:410

Alias of ChaiExpect.a.

ParameterTipo
typestring

void


below(n): void;

Definido em: fp-api.d.ts:438

Assert target < n.

ParameterTipo
nnumber

void


closeTo(expected, delta): void;

Definido em: fp-api.d.ts:457

Assert Math.abs(target - expected) <= delta.

ParameterTipo
expectednumber
deltanumber

void


deepEqual(expected): void;

Definido em: fp-api.d.ts:401

Deep structural equality.

ParameterTipo
expectedunknown

void


endWith(suffix): void;

Definido em: fp-api.d.ts:472

String-only: assert target.endsWith(suffix).

ParameterTipo
suffixstring

void


eq(expected): void;

Definido em: fp-api.d.ts:397

Alias of ChaiExpect.equal.

ParameterTipo
expectedunknown

void


eql(expected): void;

Definido em: fp-api.d.ts:399

Deep structural equality.

ParameterTipo
expectedunknown

void


equal(expected): void;

Definido em: fp-api.d.ts:393

Strict equality (Object.is). Use .deep.equal(…) for deep comparisons.

ParameterTipo
expectedunknown

void


equals(expected): void;

Definido em: fp-api.d.ts:395

Alias of ChaiExpect.equal.

ParameterTipo
expectedunknown

void


greaterThan(n): void;

Definido em: fp-api.d.ts:436

Alias of ChaiExpect.above.

ParameterTipo
nnumber

void


instanceOf(ctor): void;

Definido em: fp-api.d.ts:413

Assert target instanceof ctor.

ParameterTipo
ctorFunction

void


keys(...names): void;

Definido em: fp-api.d.ts:460

Assert target is an object whose keys exactly match the given set.

ParameterTipo
…names(string | string[])[]

void


least(n): void;

Definido em: fp-api.d.ts:442

Assert target >= n.

ParameterTipo
nnumber

void


lengthOf(n): void;

Definido em: fp-api.d.ts:447

Assert target.length === n.

ParameterTipo
nnumber

void


lessThan(n): void;

Definido em: fp-api.d.ts:440

Alias of ChaiExpect.below.

ParameterTipo
nnumber

void


match(regex): void;

Definido em: fp-api.d.ts:430

Assert target matches the given regex.

ParameterTipo
regexRegExp

void


most(n): void;

Definido em: fp-api.d.ts:444

Assert target <= n.

ParameterTipo
nnumber

void


oneOf(list): void;

Definido em: fp-api.d.ts:454

Assert target deep-equals one of the candidates.

ParameterTipo
listunknown[]

void


property(name, value?): void;

Definido em: fp-api.d.ts:422

Assert target has own/inherited property name. If a second argument is given, also assert the property’s value equals it (deep equality).

Chain .nested first to resolve dotted paths (e.g. "a.b.0.c").

ParameterTipo
namestring
value?unknown

void


satisfy(predicate): void;

Definido em: fp-api.d.ts:451

Pass when predicate(target) returns truthy.

ParameterTipo
predicate(value) => boolean

void


startWith(prefix): void;

Definido em: fp-api.d.ts:470

String-only: assert target.startsWith(prefix).

ParameterTipo
prefixstring

void


throw(matcher?): void;

Definido em: fp-api.d.ts:467

Assert target is a function that throws. Optionally narrow to a message substring, RegExp match, or error class.

ParameterTipo
matcher?string | Function | RegExp

void