2.6 KiB
2.6 KiB
id, challengeType, forumTopicId, title
id | challengeType | forumTopicId | title |
---|---|---|---|
587d7fb5367417b2b2512c01 | 2 | 301529 | 通过理解语义版本化来管理 npm 依赖关系 |
Description
"package": "MAJOR.MINOR.PATCH"
主版本号 MAJOR:当你做了不向下兼容的公共 API 修改, 次版本号 MINOR:当你添加了向下兼容的新功能, 修订号 PATCH:当你做了向下兼容的问题修正。 这意味着修订号是用来修复错误的,次版本号则是添加了新功能,但它们都没有破坏之前的功能。最后,主版本号的变更则是添加了对早期版本不兼容的更改。
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.10.2'。"
testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/package.json'').then(data => { var packJson = JSON.parse(data); assert.equal(packJson.dependencies.moment,"2.10.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.
*/