fix: Fix tests after major chai upgrade
Note that the tests for Lumina are failing, but that's not related to the chai upgrade, rather it seems these tests fail because of issues in the design that we'll tackle later (it's a brand new design yet to be released).
This commit is contained in:
parent
703f8fd6e1
commit
26e282f5b7
53 changed files with 190 additions and 347 deletions
|
@ -1,31 +1,27 @@
|
|||
import chai from 'chai'
|
||||
import { expect } from 'chai'
|
||||
|
||||
/*
|
||||
* This runs unit tests for the plugin configuration
|
||||
* It expects the following:
|
||||
*
|
||||
* @param object plugin: The plugin object
|
||||
*/
|
||||
export const sharedPluginTests = plugin => {
|
||||
|
||||
export const sharedPluginTests = (plugin) => {
|
||||
describe('Shared Plugin Tests', () => {
|
||||
it('Should have a name property', () => {
|
||||
chai.expect(typeof plugin.name).to.equal('string')
|
||||
chai.expect(plugin.name.length).to.be.greaterThan(2)
|
||||
expect(typeof plugin.name).to.equal('string')
|
||||
expect(plugin.name.length).to.be.greaterThan(2)
|
||||
})
|
||||
it('Should have a version property', () => {
|
||||
chai.expect(typeof plugin.version).to.equal('string')
|
||||
chai.expect(plugin.version.length).to.be.greaterThan(2)
|
||||
expect(typeof plugin.version).to.equal('string')
|
||||
expect(plugin.version.length).to.be.greaterThan(2)
|
||||
})
|
||||
it('Version should be a proper semantic version', () => {
|
||||
const chunks = plugin.version.split('.')
|
||||
if (chunks.length > 3) {
|
||||
chai.expect(plugin.version.split('.').length).to.equal(4)
|
||||
chai.expect(chunks[2]).to.contain.oneOf(['-alpha', '-beta', '-rc'])
|
||||
}
|
||||
else chai.expect(plugin.version.split('.').length).to.equal(3)
|
||||
expect(plugin.version.split('.').length).to.equal(4)
|
||||
expect(chunks[2]).to.contain.oneOf(['-alpha', '-beta', '-rc'])
|
||||
} else expect(plugin.version.split('.').length).to.equal(3)
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue