From 673ab2e2cd331db7e8226f4ae1d65e95e664046f Mon Sep 17 00:00:00 2001 From: Joost De Cock Date: Sat, 27 Nov 2021 16:47:39 +0100 Subject: [PATCH] chore(aaron): Updated unit tests. See #408 --- packages/aaron/package.json | 5 ++-- packages/aaron/tests/shared.test.mjs | 41 ++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 3 deletions(-) create mode 100644 packages/aaron/tests/shared.test.mjs diff --git a/packages/aaron/package.json b/packages/aaron/package.json index 759de943dab..697b6cab9fc 100644 --- a/packages/aaron/package.json +++ b/packages/aaron/package.json @@ -30,13 +30,13 @@ "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", "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": { "@freesewing/core": "^2.19.5", @@ -72,7 +72,6 @@ "prop-types": "^15.7.2", "mocha": "^9.1.1", "chai": "^4.2.0", - "chai-string": "^1.5.0", "@babel/register": "^7.10.5" }, "files": [ diff --git a/packages/aaron/tests/shared.test.mjs b/packages/aaron/tests/shared.test.mjs new file mode 100644 index 00000000000..1e0af7b5207 --- /dev/null +++ b/packages/aaron/tests/shared.test.mjs @@ -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 Aaron 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( + 'aaron', + new Aaron(), + expect, + models, + patterns +) + +// Test drafting +testPatternDrafting( + 'aaron', + Aaron, + expect, + models, + patterns +) + +// Test sampling +testPatternSampling( + 'aaron', + Aaron, + expect, + models, + patterns +)