[英]I have an error message when running my test?
what-is-a-test Message gives the name and height: Error: Expected 'is 34 inches tall' to include 'Susan' at assert (node_modules/expect/lib/assert.js:29:9) at Expectation.toInclude (node_modules/expect/lib/Expectation.js:215:28) at Context.it (test/index-test.js:19:29)
I'm not sure what needs to be fixed.我不确定需要修复什么。 Please help.
请帮忙。
You understand how to read tests, now it's time to run the tests.您了解如何阅读测试,现在是运行测试的时候了。 We've made it fairly easy.
我们已经让它变得相当容易。 In the same terminal that you used to write nodejs tests.js or nodejs index.js now, you just need to write learn.
在你现在用来编写 nodejs tests.js 或 nodejs index.js 的同一个终端中,你只需要编写学习。 That's it!
就是这样! No matter what the lab, our Learn command will figure out where you are and run the appropriate tests and give you results.
无论实验室是什么,我们的学习命令都会找出您的位置并运行适当的测试并为您提供结果。
Speaking of results... let's talk about how to read the results that tests give you.说到结果……让我们来谈谈如何阅读测试给你的结果。
Reading Results of Tests读取测试结果
If we run learn in our terminal right now, you'll get a bunch of failed tests.如果我们现在在终端中运行学习,你会得到一堆失败的测试。 It will look something like this:
它看起来像这样:
Output from running learn in Terminal在终端中运行学习的输出
> js-functions-lab@0.1.0 test /Users/joe/Documents/Documents/flatiron/js-what-is-a-test-lab
> mocha -R mocha-multi --reporter-options nyan=-,json=.results.json
0 -_-__,------,
3 -_-__| /\_/\
0 -_-_~|_( x .x)
-_-_ "" ""
0 passing (612ms)
3 failing
1) what-is-a-test Name returns "Susan":
Error: Expected 'Joe' to equal 'Susan'
+ expected - actual
-Joe
+Susan
at assert (node_modules/expect/lib/assert.js:29:9)
at Expectation.toEqual (node_modules/expect/lib/Expectation.js:81:30)
at Context.it (test/index-test.js:6:26)
2) what-is-a-test Height is less than 40:
Error: Expected 74 to be less than 40
at assert (node_modules/expect/lib/assert.js:29:9)
at Expectation.toBeLessThan (node_modules/expect/lib/Expectation.js:156:28)
at Context.it (test/index-test.js:13:28)
3) what-is-a-test Message gives the name and height:
Error: Expected ' is 74 inches tall' to include 'Joe'
at assert (node_modules/expect/lib/assert.js:29:9)
at Expectation.toInclude (node_modules/expect/lib/Expectation.js:215:28)
at Context.it (test/index-test.js:19:29)
npm ERR! Test failed. See above for more details.
Let's break this down a bit. If you look at the line under the cat (I love programmers) you'll see a summary of how the tests went:
0 passing (612ms)
3 failing
for more read data look at this link js-what-is-a-test-lab-bootcamp-prep有关更多读取数据,请查看此链接js-what-is-a-test-lab-bootcamp-prep
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.