我观看了一个教程,其中作者的建议是使用 expect
框架来编写更好的断言:
https://github.com/mjackson/expect .
但据我所知,这与
Jasmine
完全相同,而且 Jasmine 更出名。jasmine
吸收了expect
库吗?两者之间有什么实际区别吗?
最佳答案
Jasmine 是一个完整的测试框架。 Expect 只是断言,可以与 mocha 之类的东西结合使用。
在 Jasmine 主页上:
BATTERIES INCLUDED
Comes out of the box with everything you need to test your code.
正如预期的那样:
You can think of expect as a more compact alternative to Chai or Sinon.JS
我几天前读了这篇文章,决定在项目中使用什么。这是一本很好的书,很有洞察力。检查第 1 节(API),了解expect(或类似的?显然有两个expect 库)适合图片。
http://thejsguy.com/2015/01/12/jasmine-vs-mocha-chai-and-sinon.html
关于javascript - Jasmine 和expect有什么区别吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42251337/