fix: Support -rc releases in version unit test. Fixes #1886
This commit is contained in:
parent
94d9d79c5d
commit
7ddb023c8d
2 changed files with 14 additions and 1 deletions
|
@ -31,6 +31,14 @@ export const testPatternConfig = (design, pattern, expect, models, patterns) =>
|
|||
expect(typeof pattern.config.version).to.equal('string')
|
||||
expect(pattern.config.version.length > 1).to.be.true
|
||||
})
|
||||
it(` - 'version' should be a proper semantic version`, () => {
|
||||
const chunks = pattern.config.version.split('.')
|
||||
if (chunks.length > 3) {
|
||||
expect(pattern.config.version.split('.').length).to.equal(4)
|
||||
expect(chunks[2]).to.contain('-rc')
|
||||
}
|
||||
else expect(pattern.config.version.split('.').length).to.equal(3)
|
||||
})
|
||||
for (let key of ['design', 'code']) {
|
||||
it(` - '${key}' should be a string or array of strings`, () => {
|
||||
if (typeof pattern.config[key] === 'string') {
|
||||
|
|
|
@ -18,7 +18,12 @@ export const sharedPluginTests = plugin => {
|
|||
chai.expect(plugin.version.length).to.be.greaterThan(2)
|
||||
})
|
||||
it('Version should be a proper semantic version', () => {
|
||||
chai.expect(plugin.version.split('.').length).to.equal(3)
|
||||
const chunks = plugin.version.split('.')
|
||||
if (chunks.length > 3) {
|
||||
chai.expect(plugin.version.split('.').length).to.equal(4)
|
||||
chai.expect(chunks[2]).to.contain('-rc')
|
||||
}
|
||||
else chai.expect(plugin.version.split('.').length).to.equal(3)
|
||||
})
|
||||
|
||||
if ([
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue