Globally allow more statements in test files

This commit is contained in:
David Evans 2017-10-28 00:18:52 +01:00
parent 3fd9d4eb5f
commit 6884dfb525
3 changed files with 10 additions and 6 deletions

View File

@ -1,8 +1,6 @@
defineDescribe('Sequence Generator', ['./Generator'], (Generator) => {
'use strict';
/* jshint -W071 */ // Allow lots of tests
const generator = new Generator();
const AGENT_DEFINE = 'agent define';

View File

@ -1,8 +1,6 @@
defineDescribe('Sequence Parser', ['./Parser'], (Parser) => {
'use strict';
/* jshint -W071 */ // Allow lots of tests
const parser = new Parser();
describe('.tokenise', () => {

View File

@ -28,6 +28,15 @@ define(['jshintConfig', 'specs'], (jshintConfig) => {
'fail',
].concat(PREDEF);
const OPTS = Object.assign({}, jshintConfig, {
predef: PREDEF,
});
const OPTS_TEST = Object.assign({}, jshintConfig, {
predef: PREDEF_TEST,
maxstatements: 50, // allow lots of tests
});
function formatError(error) {
const evidence = (error.evidence || '').replace(/\t/g, ' ');
if(error.code === 'W140') {
@ -58,8 +67,7 @@ define(['jshintConfig', 'specs'], (jshintConfig) => {
path.endsWith('specRunner.js') ||
path.includes('/stubs/')
);
const predef = test ? PREDEF_TEST : PREDEF;
JSHINT(src, Object.assign({predef}, jshintConfig));
JSHINT(src, test ? OPTS_TEST : OPTS);
(JSHINT.errors
.map(formatError)
.filter((error) => (error !== null))