lint: Check eslint indentation for casper tests.

Now we just limit this rule for the node tests themselves.
This commit is contained in:
Tim Abbott 2018-05-06 16:50:14 -07:00
parent d3f8208715
commit ed299feb00
5 changed files with 26 additions and 21 deletions

View File

@ -14,7 +14,6 @@
},
"rules": {
"no-sync": 0,
"indent": 0,
"prefer-const": "error"
}
}

View File

@ -0,0 +1,5 @@
{
"rules": {
"indent": 0
}
}

View File

@ -31,11 +31,12 @@ let _markdownComparerInstance = null;
class MarkdownComparer {
constructor(output_formatter) {
this._output_formatter = output_formatter || function (actual, expected) {
return ["Actual and expected output do not match.",
actual,
"!=",
expected,
].join('\n');
return [
"Actual and expected output do not match.",
actual,
"!=",
expected,
].join('\n');
};
this._document = jsdom.jsdom();
}

View File

@ -11,9 +11,9 @@ exports.find_files_to_run = function () {
var testsDifference = [];
if (process.argv[2]) {
oneFileFilter = process.argv
.slice(2)
.filter(function (filename) {return (/[.]js$/).test(filename);})
.map(function (filename) {return filename.replace(/\.js$/i, '');});
.slice(2)
.filter(function (filename) {return (/[.]js$/).test(filename);})
.map(function (filename) {return filename.replace(/\.js$/i, '');});
}
// tests_dir is where we find our specific unit tests (as opposed
@ -21,9 +21,9 @@ exports.find_files_to_run = function () {
var tests_dir = __dirname.replace(/zjsunit/, 'node_tests');
var tests = fs.readdirSync(tests_dir)
.filter(function (filename) {return !(/^\./i).test(filename);})
.filter(function (filename) {return (/\.js$/i).test(filename);})
.map(function (filename) {return filename.replace(/\.js$/i, '');});
.filter(function (filename) {return !(/^\./i).test(filename);})
.filter(function (filename) {return (/\.js$/i).test(filename);})
.map(function (filename) {return filename.replace(/\.js$/i, '');});
if (oneFileFilter.length > 0) {
tests = tests.filter(function (filename) {

View File

@ -85,15 +85,15 @@ exports.template_finder = (function () {
// get all files and then map them into friendlier names.
var all_files = exports.walk(template_dir());
var files = all_files
.filter(function (file) {
return (/\.handlebars$/).test(file.name);
})
.map(function (file) {
return {
url: file.url,
name: file.name.replace(/\.handlebars$/, ""),
};
});
.filter(function (file) {
return (/\.handlebars$/).test(file.name);
})
.map(function (file) {
return {
url: file.url,
name: file.name.replace(/\.handlebars$/, ""),
};
});
self.get = function (name) {
var file = files.find(function (file) {