From 12df00b5e5ac8287afad0f2d52aa0f35a6e8a2ee Mon Sep 17 00:00:00 2001 From: bbsteventill Date: Sat, 31 Mar 2018 13:01:17 -0400 Subject: added ability to set config opts to eslint (#9) * added ability to set config opts to eslint * add spec for eslint command line --- spec/pronto/eslint_spec.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'spec') diff --git a/spec/pronto/eslint_spec.rb b/spec/pronto/eslint_spec.rb index a00a05b..0924f30 100644 --- a/spec/pronto/eslint_spec.rb +++ b/spec/pronto/eslint_spec.rb @@ -57,6 +57,15 @@ module Pronto end end + context( + 'with cmd_line_opts to include .html', + config: { 'cmd_line_opts' => '--ext .html' } + ) do + it 'returns correct number of errors' do + expect(run.count).to eql 5 + end + end + context( 'with different eslint executable', config: { 'eslint_executable' => './custom_eslint.sh' } @@ -139,6 +148,16 @@ module Pronto expect(eslint_command_line).not_to include(path) end end + + context( + 'with some command line options', + config: { 'cmd_line_opts' => '--my command --line opts' } + ) do + it 'includes the custom command line options' do + eslint.read_config + expect(eslint_command_line).to include('--my command --line opts') + end + end end end end -- cgit v1.2.3