@angular-package/testing
Version:
Jasmine unit testing wrapper with additional custom testing features.
1 lines • 1.16 kB
JavaScript
import{TestingCore}from"../testing-core.abstract";import{TestingDescribe}from"../testing-describe.class";import{TestingExpectation}from"../testing-expectation.class";import{TestingIt}from"../testing-it.class";import{TestingItToBe}from"./testing-it-to-be.class";import{TestingItToHave}from"./testing-it-to-have.class";import{TestingItToThrow}from"./testing-it-to-throw.class";import{TextualExpectation}from"../textual-expectation.abstract";export class TestingItTo extends TestingCore{get be(){return this.#t}get have(){return this.#e}get throw(){return this.#i}#t;#e;#i;constructor(t,e,i,o=[!0,!1],s=new TestingDescribe(t,i?.describe,o),r=new TestingIt(e,i?.it,o),n=new TestingExpectation){super(t,e,i,o,s,r,n),this.#t=new TestingItToBe(t,e,i,o,s,r,n),this.#e=new TestingItToHave(t,e,i,o,s,r,n),this.#i=new TestingItToThrow(t,e,i,o,s,r,n)}contain(t,e,i=TextualExpectation.toContain,o,s){return this.it(i,(()=>super.expect.to.contain(t,e,o)),s),this}equal(t,e,i=TextualExpectation.toEqual,o,s){return this.it(i,(()=>super.expect.to.equal(t,e,o)),s),this}match(t,e,i=TextualExpectation.toMatch,o,s){return this.it(i,(()=>super.expect.to.match(t,e,o)),s),this}}