2.0 KiB
2.0 KiB
id | challengeType | forumTopicId | localeTitle |
---|---|---|---|
587d7fb5367417b2b2512c03 | 2 | 301531 | 用插入字符可以使用依赖项的最新次要版本 |
Description
"package": "^1.3.8"
这会更新 package 到任意的 1.x.x 版本。
Instructions
Tests
tests:
- text: "'dependencies' 应包含 'moment'。"
testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/package.json'').then(data => { var packJson = JSON.parse(data); assert.property(packJson.dependencies, ''moment'', ''"dependencies" does not include "moment"''); }, xhr => { throw new Error(xhr.responseText); })'
- text: "'moment' 的版本应匹配 '^2.x.x'。"
testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/package.json'').then(data => { var packJson = JSON.parse(data); assert.match(packJson.dependencies.moment, /^\^2\./, ''Wrong version of "moment". It should be ^2.10.2''); }, xhr => { throw new Error(xhr.responseText); })'
Challenge Seed
Solution
/**
Backend challenges don't need solutions,
because they would need to be tested against a full working project.
Please check our contributing guidelines to learn more.
*/