| Total Complexity | 2 |
| Total Lines | 33 |
| Duplicated Lines | 0 % |
| 1 | import os |
||
| 14 | class JSHintBearTest(LocalBearTestHelper): |
||
| 15 | def setUp(self): |
||
| 16 | self.section = Section("test section") |
||
| 17 | self.uut = JSHintBear(self.section, Queue()) |
||
| 18 | self.test_file1 = os.path.join(os.path.dirname(__file__), |
||
| 19 | "test_files", |
||
| 20 | "jshint_test1.js") |
||
| 21 | self.test_file2 = os.path.join(os.path.dirname(__file__), |
||
| 22 | "test_files", |
||
| 23 | "jshint_test2.js") |
||
| 24 | self.conf_file = os.path.join(os.path.dirname(__file__), |
||
| 25 | "test_files", |
||
| 26 | "jshint_config.js") |
||
| 27 | |||
| 28 | def test_run(self): |
||
| 29 | # Test a file with errors and warnings |
||
| 30 | self.assertLinesInvalid( |
||
| 31 | self.uut, |
||
| 32 | [], |
||
| 33 | self.test_file2) |
||
| 34 | |||
| 35 | # Test a file with a warning which can be changed using a config |
||
| 36 | self.assertLinesInvalid( |
||
| 37 | self.uut, |
||
| 38 | [], |
||
| 39 | self.test_file1) |
||
| 40 | |||
| 41 | # Test if warning disappears |
||
| 42 | self.section.append(Setting("jshint_config", self.conf_file)) |
||
| 43 | self.assertLinesValid( |
||
| 44 | self.uut, |
||
| 45 | [], |
||
| 46 | self.test_file1) |
||
| 47 | |||
| 61 |