0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2025-01-20 17:10:11 -05:00

added benchmark test command

This commit is contained in:
liabru 2021-12-15 09:58:31 +00:00
parent 5c59bef62e
commit 7f34c4506e
3 changed files with 5 additions and 1 deletions

View file

@ -6,6 +6,7 @@ install:
- npm ci
script:
- npm run lint
- npm run benchmark
- npm run test
- npm run build
- npm run build-demo

View file

@ -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",

View file

@ -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;