简体   繁体   English

运行测试时出现错误消息?

[英]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.

相关问题 当我尝试测试运行我的 MySQL 数据库时收到此错误消息 - I get this error message when I try to test run my MySQL database 执行歌词命令时出现此错误:DiscordAPIError:无法发送空消息 - I have this error when i execute my lyrics command : DiscordAPIError: Cannot send an empty message 为什么我的测试套件无法运行我拥有的任何测试? - Why is my test suite not running any of the tests I have? 为什么我在运行我的应用程序时收到“Cannot GET /error”消息? - Why am I getting a "Cannot GET /error" message when running my app? 我有一条关于我的 signingSecret for slack bot 的消息错误 - I have a message error about my signingSecret for slack bot 当我运行“npm install”时,我的终端上出现此错误消息“npm ERR。Linux 5.4.72-microsoft-standard-WSL2” - I have this error message "npm ERR! Linux 5.4.72-microsoft-standard-WSL2" on my terminal when I run "npm install" 我的测试遇到了错误,我已经编译并迁移了。 我运行了“松露测试”,但出现了这个错误 - I have run into an error with my testing, i have compiled and migrated . i ran 'truffle test' and i have this error 为什么运行Protractor测试时会弹出Firefox错误消息? - Why does Firefox error message pop up when running Protractor test? 当我尝试刷新页面时出现此错误 - When i try to refresh my page i have this error 运行 discord.js 机器人时出现错误 - I get an error when running my discord.js bot
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM