We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
单元测试 一般都是给通用组件,指令 服务 管道这样的通用业务去写 页面级就用e2e测试
toBe() 等同 === toNotBe() 等同 !== toBeDefined() 等同 !== undefined toBeUndefined() 等同 === undefined toBeNull() 等同 === null toBeTruthy() 等同 !!obj toBeFalsy() 等同 !obj toBeLessThan() 等同 < toBeGreaterThan() 等同 > toEqual() 相当于 == toNotEqual() 相当于 != toContain() 相当于 indexOf toBeCloseTo() 数值比较时定义精度,先四舍五入后再比较。 toHaveBeenCalled() 检查function是否被调用过 toHaveBeenCalledWith() 检查传入参数是否被作为参数调用过 toMatch() 等同 new RegExp().test() toNotMatch() 等同 !new RegExp().test() toThrow() 检查function是否会抛出一个错误
Suites 和 Specs 分别可以用 xdescribe 和 xit 全局函数来跳过这些测试代码块。
- utils 纯函数 - pipe - class - service - directive - component
The text was updated successfully, but these errors were encountered:
No branches or pull requests
语句
Suites 和 Specs 分别可以用 xdescribe 和 xit 全局函数来跳过这些测试代码块。
写单元测试 顺序
The text was updated successfully, but these errors were encountered: