chore(plugin-bartack): Added (esm) unit tests. See #408
This commit is contained in:
parent
d2da193663
commit
53e3de410a
4 changed files with 26 additions and 11 deletions
|
@ -1,6 +1,12 @@
|
|||
# Change log for: @freesewing/plugin-bartack
|
||||
|
||||
|
||||
## unreleased (NaN-NaN-NaN)
|
||||
|
||||
### Added
|
||||
|
||||
- Added (esm) unit tests
|
||||
|
||||
|
||||
This is the **initial release**, and the start of this change log.
|
||||
|
||||
|
|
|
@ -30,18 +30,23 @@
|
|||
"clean": "rimraf dist",
|
||||
"build": "rollup -c",
|
||||
"lernabuild": "rollup -c",
|
||||
"test": "BABEL_ENV=production ../../node_modules/.bin/_mocha tests/*.test.js --require @babel/register",
|
||||
"test": "BABEL_ENV=production ../../node_modules/.bin/_mocha tests/*.test.mjs --require @babel/register",
|
||||
"pubtest": "npm publish --registry http://localhost:6662",
|
||||
"pubforce": "npm publish",
|
||||
"symlink": "mkdir -p ./node_modules/@freesewing && cd ./node_modules/@freesewing && ln -s -f ../../../* . && cd -",
|
||||
"start": "rollup -c -w",
|
||||
"prettier": "npx prettier --write 'src/*.js' 'tests/*.js'"
|
||||
"testci": "BABEL_ENV=production ../../node_modules/.bin/_mocha tests/*.test.mjs --require @babel/register",
|
||||
"prettier": "npx prettier --write 'src/*.js' 'tests/*.mjs'"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@freesewing/core": "^2.19.5"
|
||||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "^9.1.1",
|
||||
"chai": "^4.2.0",
|
||||
"@babel/register": "^7.10.5"
|
||||
},
|
||||
"files": [
|
||||
"dist/*",
|
||||
"README.md",
|
||||
|
|
|
@ -1,17 +1,11 @@
|
|||
import freesewing from '@freesewing/core'
|
||||
import { version } from '../package.json'
|
||||
import chai from 'chai'
|
||||
import freesewing from '@freesewing/core'
|
||||
import plugin from '../dist/index.js'
|
||||
|
||||
const expect = chai.expect
|
||||
const round = freesewing.utils.round
|
||||
|
||||
describe('Bartack plugin', function () {
|
||||
it('Should set the plugin name:version attribute', () => {
|
||||
const pattern = new freesewing.Pattern()
|
||||
pattern.use(plugin).render()
|
||||
expect(pattern.svg.attributes.get('freesewing:plugin-bartack')).to.equal(version)
|
||||
})
|
||||
describe('Bartack plugin Tests', () => {
|
||||
|
||||
it('draws a default bartack from a point', function () {
|
||||
const pattern = new freesewing.Pattern()
|
10
packages/plugin-bartack/tests/shared.test.mjs
Normal file
10
packages/plugin-bartack/tests/shared.test.mjs
Normal file
|
@ -0,0 +1,10 @@
|
|||
// This file is auto-generated.
|
||||
// Changes you make will be overwritten.
|
||||
import freesewing from '@freesewing/core'
|
||||
import chai from 'chai'
|
||||
import plugin from '../dist/index.mjs'
|
||||
import { sharedPluginTests } from '../../../tests/plugins/shared.mjs'
|
||||
|
||||
|
||||
// Run shared tests
|
||||
sharedPluginTests(plugin, freesewing, chai.expect)
|
Loading…
Add table
Add a link
Reference in a new issue