UNPKG

@angular-package/testing

Version:

Jasmine unit testing wrapper with additional custom testing features.

1 lines 631 B
import{is}from"@angular-package/type";export class TestingExpect{get already(){return this.#t=!0,this}get not(){return this.#e=!0,this}#t=!1;#e=!1;expect(t,e,r=(e?expect(t).withContext(e):expect(t))){return is.true(this.#e)?r.not:r}expectation(t,e,r){return e&&e(this.expect(t,r)),this}expectAsync(t,e,r,s,a=(e?expectAsync(t).withContext(e):expectAsync(t))){return s&&this.already,r&&this.not,is.true(this.#e)?is.true(this.#t)?a.not.already:a.not:is.true(this.#t)?a.already:a}getAlready(){return this.#t}getNot(){return this.#e}setAlready(t){return is.boolean(t)&&(this.#t=t),this}setNot(t){return is.boolean(t)&&(this.#e=t),this}}