-
Notifications
You must be signed in to change notification settings - Fork 130
请问test目录下的.test.js文件和.spec.js文件命名有什么含义吗? #2
New issue
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
Comments
这算是一个不成文的约定吧,比如源文件是 button.vue 或者 button.js,那么它的单元测试文件就会是 button.test.js 或者 button.spec.js 或者 button.unit.js
这么做还有一个好处,就是方面测试框架在项目中搜索所有测试文件然后运行这些文件。 比如 Karma 的配置一般我们都会写上 files: ["**/*.spec.js"] |
这下明白了,谢谢解答,👍👍 |
不用 close,方便其他人观看。 |
另外,为什么会同时存在 .test.js 和 .spec.js |
@xiaorong61 一个使用了 一个没有使用啊…… |
我眼花了。。。 |
感谢,不过规格这个词不太好理解,有什么例子吗,例如一个utils的工具很容易想到用test结尾,但是spec文件通常测试什么的是什么 |
你好,看了一下test文件下的文件,有点疑惑,为什么有些文件是以.spec做后缀名,而有些文件是以.test做后缀名,两者分别代表什么含义呢?
The text was updated successfully, but these errors were encountered: