From 7f34c4506e3456083eb927beb4a5abb9c8bfc539 Mon Sep 17 00:00:00 2001 From: liabru Date: Wed, 15 Dec 2021 09:58:31 +0000 Subject: [PATCH] added benchmark test command --- .travis.yml | 1 + package.json | 1 + test/Examples.spec.js | 4 +++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3d03717..fdb6065 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,7 @@ install: - npm ci script: - npm run lint + - npm run benchmark - npm run test - npm run build - npm run build-demo \ No newline at end of file diff --git a/package.json b/package.json index 0ac01da..f3c1c77 100644 --- a/package.json +++ b/package.json @@ -50,6 +50,7 @@ "lint": "eslint 'src/**/*.js' 'demo/src/**/*.js' 'examples/*.js' 'webpack.*.js'", "doc": "yuidoc --config yuidoc.json --project-version $npm_package_version", "doc-watch": "nodemon --delay 3 --watch 'matter-doc-theme' --watch src -e 'js,html,css,handlebars' --exec 'npm run doc'", + "benchmark": "EXAMPLES=stress3 npm run test-node", "test": "npm run test-node", "test-all": "jest --no-cache", "test-save": "SAVE=true npm run test-node", diff --git a/test/Examples.spec.js b/test/Examples.spec.js index a40bb42..fd30ca9 100644 --- a/test/Examples.spec.js +++ b/test/Examples.spec.js @@ -18,12 +18,14 @@ const MatterBuild = requireUncached('../build/matter'); const { versionSatisfies } = requireUncached('../src/core/Plugin'); const Worker = require('jest-worker').default; +const specificExamples = process.env.EXAMPLES ? process.env.EXAMPLES.split(' ') : null; const testComparison = process.env.COMPARE === 'true'; const saveComparison = process.env.SAVE === 'true'; + const excludeExamples = ['svg', 'terrain']; const excludeJitter = ['stack', 'circleStack', 'restitution', 'staticFriction', 'friction', 'newtonsCradle', 'catapult']; -const examples = Object.keys(Example).filter(key => { +const examples = (specificExamples || Object.keys(Example)).filter(key => { const excluded = excludeExamples.includes(key); const buildVersion = MatterBuild.version; const exampleFor = Example[key].for;