UNPKG

@angular-package/testing

Version:

Jasmine unit testing wrapper with additional custom testing features.

1 lines 2.61 kB
import{are}from"@angular-package/type";import{Expect}from"../expect.class";export class TestingExpectToBeArrayOf extends Expect{expectationFailOutput="The expected value should";bigint(t,e=!0,r=`${this.expectationFailOutput} ${!0===this.getNot()?"not":""} be an \`array\` of \`date\``){return are.bigint(...t).every((a=>this.toBe(e,a&&Array.isArray(t)&&t.length>0,r))),this}boolean(t,e=!0,r=`${this.expectationFailOutput} ${!0===this.getNot()?"not":""} be an \`array\` of \`boolean\``){return are.boolean(...t).every((a=>this.toBe(e,a&&Array.isArray(t)&&t.length>0,r))),this}date(t,e=!0,r=`${this.expectationFailOutput} ${!0===this.getNot()?"not":""} be an \`array\` of \`date\``){return are.date(...t).every((a=>this.toBe(e,a&&Array.isArray(t)&&t.length>0,r))),this}defined(t,e=!0,r=`${this.expectationFailOutput} ${!0===this.getNot()?"not":""} be an \`array\` of defined`){return are.defined(...t).every((a=>this.toBe(e,a&&Array.isArray(t)&&t.length>0,r))),this}number(t,e=!0,r=`${this.expectationFailOutput} ${!0===this.getNot()?"not":""} be an \`array\` of \`number\``){return are.number(...t).every((a=>this.toBe(e,a&&Array.isArray(t)&&t.length>0,r))),this}null(t,e=!0,r=`${this.expectationFailOutput} ${!0===this.getNot()?"not":""} be an \`array\` of \`null\``){return are.null(...t).every((a=>this.toBe(e,a&&Array.isArray(t)&&t.length>0,r))),this}false(t,e=!0,r=`${this.expectationFailOutput} ${!0===this.getNot()?"not":""} be an \`array\` of \`false\``){return are.false(...t).every((a=>this.toBe(e,a&&Array.isArray(t)&&t.length>0,r))),this}regExp(t,e=!0,r=`${this.expectationFailOutput} ${!0===this.getNot()?"not":""} be an \`array\` of \`regexp\``){return are.regexp(...t).every((a=>this.toBe(e,a&&Array.isArray(t)&&t.length>0,r))),this}string(t,e=!0,r=`${this.expectationFailOutput} ${!0===this.getNot()?"not":""} be an \`array\` of \`string\``){return are.string(...t).every((a=>this.toBe(e,a&&Array.isArray(t)&&t.length>0,r))),this}symbol(t,e=!0,r=`${this.expectationFailOutput} ${!0===this.getNot()?"not":""} be an \`array\` of \`symbol\``){return are.symbol(...t).every((a=>this.toBe(e,a&&Array.isArray(t)&&t.length>0,r))),this}true(t,e=!0,r=`${this.expectationFailOutput} ${!0===this.getNot()?"not":""} be an \`array\` of \`true\``){return are.true(...t).every((a=>this.toBe(e,a&&Array.isArray(t)&&t.length>0,r))),this}undefined(t,e=!0,r=`${this.expectationFailOutput} ${!0===this.getNot()?"not":""} be an \`array\` of \`undefined\``){return are.undefined(...t).every((a=>this.toBe(e,a&&Array.isArray(t)&&t.length>0,r))),this}toBe(t=!0,e,r){return this.expect(e,r).toBe(t),this.setNot(!1),e}}