freeCodeCamp/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-projects/metric-imperial-converter.md

64 lines
2.7 KiB
Markdown
Raw Normal View History

---
id: 587d8249367417b2b2512c41
challengeType: 4
videoUrl: ''
2020-10-01 15:54:21 +00:00
title: 公制 - 英制转换器
---
## Description
<section id="description">构建一个功能类似于此的完整堆栈JavaScript应用程序 <a href="https://incongruous-beard.glitch.me/" target="_blank">https://incongruous-beard.glitch.me/</a>。在这个项目上工作将涉及您在我们的入门项目上在Glitch上编写代码。完成此项目后您可以将公共故障网址到应用程序的主页复制到此屏幕进行测试您可以选择在另一个平台上编写项目但必须公开显示我们的测试。使用<a href="https://glitch.com/#!/import/github/freeCodeCamp/boilerplate-project-metricimpconverter/">此链接</a>在Glitch上启动此项目或在GitHub上克隆<a href="https://github.com/freeCodeCamp/boilerplate-project-metricimpconverter/">此存储库</a> 如果您使用Glitch请记住将项目链接保存到安全的地方 </section>
## Instructions
<section id="instructions">
</section>
## Tests
<section id='tests'>
```yml
tests:
- text: 我将阻止客户端尝试猜测嗅探MIME类型。
testString: ''
- text: 我会阻止跨站点脚本XSS攻击。
testString: ''
- text: 我可以使用包含可接受的数字和单位的单个参数进行GET / api / convert并将其转换。 (提示:通过查找将标记单元开头的第一个字符的索引来拆分输入)
testString: ''
- text: 我可以将'gal'转换为'L',反之亦然。 1加仑到3.78541升)
testString: ''
- text: 我可以将'lbs'转换为'kg',反之亦然。 1磅至0.453592千克)
testString: ''
- text: 我可以将'mi'转换为'km',反之亦然。 1英里到1.60934公里)
testString: ''
- text: 如果我的计量单位无效,则返回“无效单位”。
testString: ''
- text: 如果我的号码无效,则返回“无效号码”。
testString: ''
- text: 如果两者都无效,则返回“无效数字和单位”。
testString: ''
- text: '我可以在我的参数中使用分数小数或两者即5,1 / 2,2.5 / 6但如果没有提供则默认为1。'
testString: ''
- text: '我的返回将包含initNuminitUnitreturnNumreturnUnit和字符串拼写单元格式为“{initNum} {initial_Units}转换为{returnNum} {return_Units}”结果舍入为字符串中的5位小数。'
testString: ''
- text: 所有16个单元测试都已完成并通过。
testString: ''
- text: 所有5个功能测试都已完成并通过。
testString: ''
```
</section>
## Challenge Seed
<section id='challengeSeed'>
</section>
## Solution
<section id='solution'>
```js
// solution required
```
</section>