From 295096252547f3abb76788fbadf0ce059e74f2cc Mon Sep 17 00:00:00 2001 From: Markus Doits Date: Mon, 25 Jul 2016 16:03:07 +0200 Subject: Use system eslint instead of eslintrb This makes sure `eslint` works as expected, e.g. the config used is respected and full feature set is present. One has to make sure `eslint` is properly installed, though. --- spec/fixtures/eslintignore.git/.eslintrc | 7 +++++++ spec/fixtures/test.git/.eslintrc | 7 +++++++ spec/fixtures/test.git/hello.js | 2 ++ spec/pronto/eslint_spec.rb | 12 ++++++------ 4 files changed, 22 insertions(+), 6 deletions(-) create mode 100644 spec/fixtures/eslintignore.git/.eslintrc create mode 100644 spec/fixtures/test.git/.eslintrc (limited to 'spec') diff --git a/spec/fixtures/eslintignore.git/.eslintrc b/spec/fixtures/eslintignore.git/.eslintrc new file mode 100644 index 0000000..f94ba96 --- /dev/null +++ b/spec/fixtures/eslintignore.git/.eslintrc @@ -0,0 +1,7 @@ +{ + "env": { + "browser": true, + "es6": true + }, + "extends": "eslint:recommended" +} diff --git a/spec/fixtures/test.git/.eslintrc b/spec/fixtures/test.git/.eslintrc new file mode 100644 index 0000000..f94ba96 --- /dev/null +++ b/spec/fixtures/test.git/.eslintrc @@ -0,0 +1,7 @@ +{ + "env": { + "browser": true, + "es6": true + }, + "extends": "eslint:recommended" +} diff --git a/spec/fixtures/test.git/hello.js b/spec/fixtures/test.git/hello.js index 2d1b996..6ad633d 100644 --- a/spec/fixtures/test.git/hello.js +++ b/spec/fixtures/test.git/hello.js @@ -3,3 +3,5 @@ function HelloWorld(name) if (foo) foo++; alert(name); } + +function Empty() {} diff --git a/spec/pronto/eslint_spec.rb b/spec/pronto/eslint_spec.rb index 1117e15..27f57d1 100644 --- a/spec/pronto/eslint_spec.rb +++ b/spec/pronto/eslint_spec.rb @@ -17,22 +17,22 @@ module Pronto it { should == [] } end - context 'patches with a four and a five warnings' do + context 'patches with a one and a four warnings' do include_context 'test repo' let(:patches) { repo.diff('master') } - its(:count) { should == 9 } - its(:'first.msg') { should == "Expected { after 'if' condition." } + its(:count) { should == 5 } + its(:'first.msg') { should == "'foo' is not defined." } end - context 'repo with ignored and not ignored file, each with five warnings' do + context 'repo with ignored and not ignored file, each with three warnings' do include_context 'eslintignore repo' let(:patches) { repo.diff('master') } - its(:count) { should == 5 } - its(:'first.msg') { should == "Use the function form of 'use strict'." } + its(:count) { should == 3 } + its(:'first.msg') { should == "'HelloWorld' is defined but never used" } end end end -- cgit v1.2.3