forked from coala/coala-bears
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJSHintBearTest.py
36 lines (27 loc) · 1012 Bytes
/
JSHintBearTest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from bears.js.JSHintBear import JSHintBear
from tests.LocalBearTestHelper import verify_local_bear
from coalib.misc.ContextManagers import prepare_file
test_file1 = """
var name = (function() { return 'Anton' }());
""".splitlines(keepends=True)
test_file2 = """
function () {
}()
""".splitlines(keepends=True)
config_file = """
{
"lastsemic": true,
"maxlen": 80
}
""".splitlines(keepends=True)
JSHintBear1Test = verify_local_bear(JSHintBear,
valid_files=(),
invalid_files=(test_file1, test_file2))
with prepare_file(config_file,
filename=None,
force_linebreaks=True,
create_tempfile=True) as (conf_lines, conf_file):
JSHintBear2Test = verify_local_bear(JSHintBear,
valid_files=(test_file1,),
invalid_files=(),
settings={"jshint_config": conf_file})