Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
SamVerschueren committed Jan 11, 2017
1 parent 74535b9 commit 7873440
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 22 deletions.
15 changes: 13 additions & 2 deletions test/fixtures/rule-tester.js
@@ -1,7 +1,6 @@
'use strict';
const lint = require('../../').lint;
const Fixer = require('../../lib/fixer');
const fix = require('./utils').fix;

const testFix = (t, validation, output) => {
const fixer = new Fixer();
Expand All @@ -11,6 +10,18 @@ const testFix = (t, validation, output) => {
});
};

const clean = validations => {
for (const validation of validations) {
if (typeof validation.fix !== 'function') {
throw new TypeError(`Expected \`.fix\` to be a \`function\`, got \`${typeof validation.fix}\``);
}

delete validation.fix;
}

return validations;
};

module.exports = options => {
options = Object.assign({inherit: false}, options);

Expand All @@ -29,7 +40,7 @@ module.exports = options => {
})
.then(validations => {
if (expectedFixes) {
validations = fix(validations);
validations = clean(validations);
}

if (expectedValidations) {
Expand Down
20 changes: 0 additions & 20 deletions test/fixtures/utils.js

This file was deleted.

0 comments on commit 7873440

Please sign in to comment.