Command line args:
--js-flags="--stack-trace-limit 20"
| 'use strict'; | |
| const fs = require('fs'); | |
| module.exports = { | |
| '*.js': [ | |
| 'eslint --fix', | |
| (files) => { | |
| const tests = findTests(files); | |
| return tests.length ? `npm run test:files -- ${tests.join(' ')}` : 'echo'; |
| 'use strict'; | |
| const fs = require('fs'); | |
| exports.readJsonFile = function (file, callback) { | |
| fs.readFile(file, 'utf8', (err, content) => { | |
| if (err) { | |
| callback(err); | |
| return; | |
| } |
| describe('diff', function () { | |
| it('is shown with no diff', function () { | |
| var e = new Error(); | |
| e.showDiff = true; // because the showDiff fix is not in a release yet | |
| throw e; | |
| }); | |
| }); |
| /*global describe, it*/ | |
| 'use strict'; | |
| var assert = require('assert'); | |
| describe('diff', function () { | |
| it('works', function () { | |
| assert.equal('foo', 'bar'); | |
| }); |
| /*jslint node: true */ | |
| 'use strict'; | |
| var x = require('x'); | |
| function foo() { | |
| var y = 'bar'; | |
| } | |
| // JSLint reports "Unused 'y'.", but not Unused 'x'. |
Command line args:
--js-flags="--stack-trace-limit 20"
| (function () { | |
| "use strict"; | |
| var callee = "callee"; // Trick JSLint. It hates arguments.callee. | |
| var isStrict = false; | |
| try { | |
| if (!arguments[callee]) { | |
| throw new Error(); | |
| } | |
| } catch (e) { |
| #!/bin/bash | |
| # | |
| # Copyright (c) 2013 Maximilian Antoni | |
| # | |
| export TEST_COLOR_GREEN="\033[1m\033[32m" | |
| export TEST_COLOR_RED="\033[1m\033[31m" | |
| export TEST_COLOR_TITLE="\033[1m\033[36m" | |
| export TEST_COLOR_OFF="\033[0m" | |
| export TEST_SPACES=" " | |
| export TEST_LINE="-----------------------------------------------------" |