Skip to content

assertcheck v1.0.0


assertcheck / assert / partition

Function: partition() ​

ts
function partition<T>(
   arr, 
   predicate, 
   expectedMatch, 
   expectedRest, 
   opts?): void;

Defined in: src/assert.ts:1451

Asserts the sizes of both partitions produced by _.partition.

Type Parameters ​

Type Parameter
T

Parameters ​

ParameterType
arrT[]
predicate(v) => boolean
expectedMatchnumber
expectedRestnumber
opts?Opts

Returns ​

void

Example ​

ts
`assert.partition(jobs, j => j.done, 8, 2, "8 done, 2 pending")`

Released under the Apache 2.0 License. Built by Vagabond Studio — senior-only for growing companies.