summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorEric Stern <github@ericstern.com>2017-08-22 13:35:09 -0700
committerw0rp <w0rp@users.noreply.github.com>2017-08-22 21:35:09 +0100
commit2f19cf874b33f55312d1a5814eab16f8eec7432e (patch)
treef82c742bd303bd6ebbc73d5eaa8fe7ee90d3c975 /test
parent1a524ca63e51092ab10febea40a6f018b6e85173 (diff)
downloadale-2f19cf874b33f55312d1a5814eab16f8eec7432e.zip
Suppress warning about .eslintignore'd file (#836)
* Suppress warning about .eslintignore'd file * Fix slightly ironic lint error * Lock error suppression behind a variable; add docs and tests
Diffstat (limited to 'test')
-rw-r--r--test/eslint-test-files/eslintignore/ignored.js1
-rw-r--r--test/test_eslint_suppress_eslintignore.vader38
2 files changed, 39 insertions, 0 deletions
diff --git a/test/eslint-test-files/eslintignore/ignored.js b/test/eslint-test-files/eslintignore/ignored.js
new file mode 100644
index 00000000..4ec1fa47
--- /dev/null
+++ b/test/eslint-test-files/eslintignore/ignored.js
@@ -0,0 +1 @@
+var foo = "bar";
diff --git a/test/test_eslint_suppress_eslintignore.vader b/test/test_eslint_suppress_eslintignore.vader
new file mode 100644
index 00000000..2893d21a
--- /dev/null
+++ b/test/test_eslint_suppress_eslintignore.vader
@@ -0,0 +1,38 @@
+Before:
+ Save g:ale_javascript_eslint_suppress_eslintignore
+
+ call ale#test#SetDirectory('/testplugin/test')
+
+ runtime ale_linters/javascript/eslint.vim
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+ call ale#linter#Reset()
+
+Execute(eslint should warn about ignored file):
+ call ale#test#SetFilename('eslint-test-files/eslintignore/ignore.js')
+
+ AssertEqual
+ \ [{
+ \ 'lnum': 0,
+ \ 'col': 0,
+ \ 'type': 'W',
+ \ 'text': 'File ignored because of a matching ignore pattern. Use "--no-ignore" to override. [Warning]'
+ \ }],
+ \ ale#handlers#eslint#Handle(347, [
+ \ '/path/to/some/ignored.js:0:0: File ignored because of a matching ignore pattern. Use "--no-ignore" to override. [Warning]',
+ \ ])
+
+
+Execute(eslint should not warn about ignored file when configured):
+ let g:ale_javascript_eslint_suppress_eslintignore = 1
+
+ call ale#test#SetFilename('eslint-test-files/eslintignore/ignore.js')
+
+ AssertEqual
+ \ [],
+ \ ale#handlers#eslint#Handle(347, [
+ \ '/path/to/some/ignored.js:0:0: File ignored because of a matching ignore pattern. Use "--no-ignore" to override. [Warning]',
+ \ ])