def test_validate_and_parse_js_and_ts_files_with_exception(self):

    def mock_parse_script(unused_file_content, comment):
        raise Exception('Exception raised from parse_script()')
    esprima_swap = self.swap(esprima, 'parseScript', mock_parse_script)
    with esprima_swap, self.assertRaisesRegexp(Exception, 'Exception raised from parse_script\\(\\)'):
        js_ts_linter.JsTsLintChecksManager([], [VALID_JS_FILEPATH], FILE_CACHE).perform_all_lint_checks()
def test_validate_and_parse_js_and_ts_files_with_exception(self):

    def mock_parse_script(unused_file_content, comment):
        raise Exception('Exception raised from parse_script()')
    esprima_swap = self.swap(esprima, 'parseScript', mock_parse_script)
    with esprima_swap, self.assertRaisesRegexp(Exception, 'Exception raised from parse_script\\(\\)'):
        js_ts_linter.JsTsLintChecksManager([], [VALID_JS_FILEPATH], FILE_CACHE).perform_all_lint_checks()