chore(florent): Updated unit tests. See #408
This commit is contained in:
parent
b017add673
commit
47bc5cee85
2 changed files with 43 additions and 3 deletions
|
@ -30,13 +30,13 @@
|
||||||
"clean": "rimraf dist",
|
"clean": "rimraf dist",
|
||||||
"build": "rollup -c",
|
"build": "rollup -c",
|
||||||
"lernabuild": "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",
|
"pubtest": "npm publish --registry http://localhost:6662",
|
||||||
"pubforce": "npm publish",
|
"pubforce": "npm publish",
|
||||||
"symlink": "mkdir -p ./node_modules/@freesewing && cd ./node_modules/@freesewing && ln -s -f ../../../* . && cd -",
|
"symlink": "mkdir -p ./node_modules/@freesewing && cd ./node_modules/@freesewing && ln -s -f ../../../* . && cd -",
|
||||||
"start": "rollup -c -w",
|
"start": "rollup -c -w",
|
||||||
"netlify": "echo \"Not configured yet\"",
|
"netlify": "echo \"Not configured yet\"",
|
||||||
"testci": "BABEL_ENV=production ./node_modules/.bin/_mocha tests/*.test.js --require @babel/register"
|
"testci": "BABEL_ENV=production ./node_modules/.bin/_mocha tests/*.test.mjs --require @babel/register"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@freesewing/core": "^2.19.5",
|
"@freesewing/core": "^2.19.5",
|
||||||
|
@ -71,7 +71,6 @@
|
||||||
"prop-types": "^15.7.2",
|
"prop-types": "^15.7.2",
|
||||||
"mocha": "^9.1.1",
|
"mocha": "^9.1.1",
|
||||||
"chai": "^4.2.0",
|
"chai": "^4.2.0",
|
||||||
"chai-string": "^1.5.0",
|
|
||||||
"@babel/register": "^7.10.5"
|
"@babel/register": "^7.10.5"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
|
|
41
packages/florent/tests/shared.test.mjs
Normal file
41
packages/florent/tests/shared.test.mjs
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
// This file is auto-generated.
|
||||||
|
// Changes you make will be overwritten.
|
||||||
|
import chai from 'chai'
|
||||||
|
import models from '@freesewing/models'
|
||||||
|
import patterns from '@freesewing/pattern-info'
|
||||||
|
import Florent from '../dist/index.mjs'
|
||||||
|
|
||||||
|
// Shared tests
|
||||||
|
import { testPatternConfig } from '../../../tests/patterns/config.mjs'
|
||||||
|
import { testPatternDrafting } from '../../../tests/patterns/drafting.mjs'
|
||||||
|
import { testPatternSampling } from '../../../tests/patterns/sampling.mjs'
|
||||||
|
|
||||||
|
const expect = chai.expect
|
||||||
|
|
||||||
|
|
||||||
|
// Test config
|
||||||
|
testPatternConfig(
|
||||||
|
'florent',
|
||||||
|
new Florent(),
|
||||||
|
expect,
|
||||||
|
models,
|
||||||
|
patterns
|
||||||
|
)
|
||||||
|
|
||||||
|
// Test drafting
|
||||||
|
testPatternDrafting(
|
||||||
|
'florent',
|
||||||
|
Florent,
|
||||||
|
expect,
|
||||||
|
models,
|
||||||
|
patterns
|
||||||
|
)
|
||||||
|
|
||||||
|
// Test sampling
|
||||||
|
testPatternSampling(
|
||||||
|
'florent',
|
||||||
|
Florent,
|
||||||
|
expect,
|
||||||
|
models,
|
||||||
|
patterns
|
||||||
|
)
|
Loading…
Add table
Add a link
Reference in a new issue