From d1e56faecfc19a755479f72ac2894ed345f17b47 Mon Sep 17 00:00:00 2001 From: Ilan Biala Date: Sat, 28 Mar 2015 19:18:56 -0400 Subject: [PATCH 1/4] Match against ES5/ES6 JavaScript files Fixes #144. --- lib/plato.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/plato.js b/lib/plato.js index 3aabab6f..648be3b4 100644 --- a/lib/plato.js +++ b/lib/plato.js @@ -86,7 +86,7 @@ exports.inspect = function(files, outputDir, options, done) { return path.join(file,innerFile); }); runReports(files); - } else if (file.match(/\.js$/)) { + } else if (file.match(/\.(js|es|es6)$/)) { log.info('Reading "%s"', file); var fileShort = file.replace(commonBasePath, ''); From d6fa5f4a6690628c087b3cad7818ab2103f7242c Mon Sep 17 00:00:00 2001 From: Ilan Biala Date: Sat, 28 Mar 2015 19:20:54 -0400 Subject: [PATCH 2/4] Create test.es --- test/fixtures/test.es | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 test/fixtures/test.es diff --git a/test/fixtures/test.es b/test/fixtures/test.es new file mode 100644 index 00000000..ae256fb5 --- /dev/null +++ b/test/fixtures/test.es @@ -0,0 +1,11 @@ +var a = 1; + +function fnA(arg) { + return arg; +} + +function fnB(arg) { + return arg; +} + +var b = fnB(1) + fnA(2); From cbbfe833878c612ee2e86329fdbf961002867b03 Mon Sep 17 00:00:00 2001 From: Ilan Biala Date: Sat, 28 Mar 2015 19:24:02 -0400 Subject: [PATCH 3/4] Add file ending check test --- test/plato_test.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/test/plato_test.js b/test/plato_test.js index c0cfaa0c..29d850b0 100644 --- a/test/plato_test.js +++ b/test/plato_test.js @@ -115,7 +115,6 @@ exports['plato'] = { test.done(); }); }, - 'should run jshint with default config' : function(test) { var files = [ @@ -130,5 +129,18 @@ exports['plato'] = { test.ok(overview.summary.total.jshint === 2, 'Should contain total jshint issues'); test.done(); }); + }, + 'test file ending checks' : function(test) { + var files = [ + 'test/fixtures/test.es' + ]; + + text.expect(1); + + plato.inspect(files, null, {}, function(reports) { + var overview = plato.getOverviewReport(reports); + test.ok(reports.length === 1, 'Should analyze 1 file'); + test.done(); + }); } }; From 418c435e6b665375efbb60a1fa00834bd4966884 Mon Sep 17 00:00:00 2001 From: Ilan Biala Date: Tue, 23 Jun 2015 12:51:39 -0400 Subject: [PATCH 4/4] Update plato_test.js --- test/plato_test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/plato_test.js b/test/plato_test.js index 29d850b0..4c9d4dfb 100644 --- a/test/plato_test.js +++ b/test/plato_test.js @@ -135,7 +135,7 @@ exports['plato'] = { 'test/fixtures/test.es' ]; - text.expect(1); + test.expect(1); plato.inspect(files, null, {}, function(reports) { var overview = plato.getOverviewReport(reports);