什么是"预期"在角JS使用的功能 [英] what is the "expect" function used in angular js

查看:128
本文介绍了什么是"预期"在角JS使用的功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在角文档,他们这样写:

In the Angular documentation they write this:

预期(scope.counter).to​​Equal(0);

这是写在很多地方像这里

and this was written in many places like here.

我只是想知道那是什么

推荐答案

这是茉莉花的单元测试框架的语法单元测试的。角用途,提倡和鼓励单元测试实践的。

This is Jasmine unit testing framework syntax for unit tests. Angular uses, promotes and encourages unit testing practices.

测试性是非常认真地对待在AngularJS和框架的作者请确保使用AngularJS书面code很容易测试:

Testability is taken very seriously in AngularJS and the authors of the framework make sure that code written using AngularJS is easy to test:


  • 内置依赖注入(DI)系统可以很容易地从较小的,行之有效的元素
  • 应用程序相结合
  • 随行工装 - Testacular - 可以很容易地编写并在实践中执行测试

  • Built-in dependency injection (DI) system makes it easy to combine an application from smaller, well tested elements
  • Accompanying tooling - Testacular - makes it easy to write and execute tests in practice

AngularJS具有也为更高级别的溶液中,端至端的测试。端到端测试使用了一个非常类似的语法(所以你也会注意到期望关键字),但这些都不是茉莉花的测试。更多信息可以在这里找到:<一href=\"http://stackoverflow.com/a/13213262/1418796\">http://stackoverflow.com/a/13213262/1418796

AngularJS has also a solution for higher-level, end-to-end testing. E2e tests use a very similar syntax (so you will also notice the expect keyword) but those are not Jasmine tests. More info can be found here: http://stackoverflow.com/a/13213262/1418796

这篇关于什么是&QUOT;预期&QUOT;在角JS使用的功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆