1
0
Fork 0

chore: Migrated plugin tests to named exports

This commit is contained in:
Joost De Cock 2022-08-28 11:03:01 +02:00
parent c09ae4aa69
commit 15dbb867ac
2 changed files with 4 additions and 18 deletions

View file

@ -1,8 +1,7 @@
// This file is auto-generated. // This file is auto-generated | Any changes you make will be overwritten.
// Changes you make will be overwritten. import { plugin } from './dist/index.mjs'
import plugin from './dist/index.mjs'
import { sharedPluginTests } from '../../../tests/plugins/shared.mjs' import { sharedPluginTests } from '../../../tests/plugins/shared.mjs'
// Run shared tests // Run shared tests
sharedPluginTests(plugin) sharedPluginTests(plugin)

View file

@ -1,4 +1,4 @@
import freesewing from '@freesewing/core' import { Pattern } from '@freesewing/core'
import chai from 'chai' import chai from 'chai'
/* /*
* This runs unit tests for the plugin configuration * 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) 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)
})
}
}) })
} }