Skip to content

Commit

Permalink
Merge pull request #282 from lo1tuma/benchmark-all-tests
Browse files Browse the repository at this point in the history
Enable all rules during runtime benchmark
  • Loading branch information
lo1tuma authored May 26, 2021
2 parents 8434c97 + 111701d commit 70d59af
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions benchmarks/runtime.bench.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,28 @@ const { Linter } = require('eslint');
const times = require('ramda/src/times');
const toPairs = require('ramda/src/toPairs');
const fromPairs = require('ramda/src/fromPairs');
const { runBenchmark, cpuSpeed, getNodeVersionMultiplier } = require('./measure');
const {
runBenchmark,
cpuSpeed,
getNodeVersionMultiplier
} = require('./measure');
const mochaPlugin = require('../');

const recommendedRules = mochaPlugin.configs.recommended.rules;
const allRules = mochaPlugin.configs.all.rules;

function lintManyFilesWithAllRecommendedRules({ numberOfFiles }) {
const linter = new Linter();

linter.defineRules(mochaPlugin.rules);

const config = {
rules: fromPairs(toPairs(recommendedRules).map(([ ruleName, ruleSettings ]) => {
const [ , ruleNameWithoutPrefix ] = ruleName.split('/');
rules: fromPairs(
toPairs(allRules).map(([ ruleName, ruleSettings ]) => {
const [ , ruleNameWithoutPrefix ] = ruleName.split('/');

return [ ruleNameWithoutPrefix, ruleSettings ];
})),
return [ ruleNameWithoutPrefix, ruleSettings ];
})
),
parserOptions: {
ecmaVersion: 2018
}
Expand Down

0 comments on commit 70d59af

Please sign in to comment.