chore: Migrated plugin tests to named exports
This commit is contained in:
parent
c09ae4aa69
commit
15dbb867ac
2 changed files with 4 additions and 18 deletions
|
@ -1,8 +1,7 @@
|
|||
// This file is auto-generated.
|
||||
// Changes you make will be overwritten.
|
||||
import plugin from './dist/index.mjs'
|
||||
// This file is auto-generated | Any changes you make will be overwritten.
|
||||
import { plugin } from './dist/index.mjs'
|
||||
import { sharedPluginTests } from '../../../tests/plugins/shared.mjs'
|
||||
|
||||
|
||||
// Run shared tests
|
||||
sharedPluginTests(plugin)
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import freesewing from '@freesewing/core'
|
||||
import { Pattern } from '@freesewing/core'
|
||||
import chai from 'chai'
|
||||
/*
|
||||
* This runs unit tests for the plugin configuration
|
||||
|
@ -26,19 +26,6 @@ export const sharedPluginTests = plugin => {
|
|||
else chai.expect(plugin.version.split('.').length).to.equal(3)
|
||||
})
|
||||
|
||||
if ([
|
||||
// These don't set their version
|
||||
'@freesewing/plugin-versionfree-svg',
|
||||
'@freesewing/plugin-bundle',
|
||||
].indexOf(plugin.name) === -1) {
|
||||
const pattern = new freesewing.Pattern().use(plugin)
|
||||
pattern.draft().render()
|
||||
const version = plugin.name.split('@').pop().split('/').join(':')
|
||||
|
||||
it('Should set the plugin name:version attribute', () => {
|
||||
chai.expect(pattern.svg.attributes.get(version)).to.equal(plugin.version)
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue