def test_ts_ignore_found_error(self):

    def mock_compile_all_ts_files():
        cmd = ('./node_modules/typescript/bin/tsc -outDir %s -allowJS %s -lib %s -noImplicitUseStrict %s -skipLibCheck %s -target %s -typeRoots %s %s typings/*' % ((js_ts_linter.COMPILED_TYPESCRIPT_TMP_PATH + 'scripts/linters/test_files/'), 'true', 'es2017,dom', 'true', 'true', 'es5', './node_modules/@types', INVALID_TS_IGNORE_FILEPATH))
        subprocess.call(cmd, shell=True, stdout=subprocess.PIPE)
    ts_ignore_exceptions_swap = self.swap(js_ts_linter, 'TS_IGNORE_EXCEPTIONS', {})
    compile_all_ts_files_swap = self.swap(js_ts_linter, 'compile_all_ts_files', mock_compile_all_ts_files)
    with compile_all_ts_files_swap, ts_ignore_exceptions_swap:
        lint_task_report = js_ts_linter.JsTsLintChecksManager([], [INVALID_TS_IGNORE_FILEPATH], FILE_CACHE).perform_all_lint_checks()
    shutil.rmtree(js_ts_linter.COMPILED_TYPESCRIPT_TMP_PATH, ignore_errors=True)
    expected_messages = ['@ts-ignore found at line 25.']
    expected_messages.extend(['@ts-ignore found at line 31.'])
    expected_messages.extend(['Please add a comment above the @ts-ignore explaining the @ts-ignore at line 25. The format of comment should be -> This throws "...". This needs to be suppressed because ...'])
    expected_messages.extend(['Please add a comment above the @ts-ignore explaining the @ts-ignore at line 31. The format of comment should be -> This throws "...". This needs to be suppressed because ...'])
    self.validate(lint_task_report, expected_messages, 1)
def test_ts_ignore_found_error(self):

    def mock_compile_all_ts_files():
        cmd = ('./node_modules/typescript/bin/tsc -outDir %s -allowJS %s -lib %s -noImplicitUseStrict %s -skipLibCheck %s -target %s -typeRoots %s %s typings/*' % ((js_ts_linter.COMPILED_TYPESCRIPT_TMP_PATH + 'scripts/linters/test_files/'), 'true', 'es2017,dom', 'true', 'true', 'es5', './node_modules/@types', INVALID_TS_IGNORE_FILEPATH))
        subprocess.call(cmd, shell=True, stdout=subprocess.PIPE)
    ts_ignore_exceptions_swap = self.swap(js_ts_linter, 'TS_IGNORE_EXCEPTIONS', {})
    compile_all_ts_files_swap = self.swap(js_ts_linter, 'compile_all_ts_files', mock_compile_all_ts_files)
    with compile_all_ts_files_swap, ts_ignore_exceptions_swap:
        lint_task_report = js_ts_linter.JsTsLintChecksManager([], [INVALID_TS_IGNORE_FILEPATH], FILE_CACHE).perform_all_lint_checks()
    shutil.rmtree(js_ts_linter.COMPILED_TYPESCRIPT_TMP_PATH, ignore_errors=True)
    expected_messages = ['@ts-ignore found at line 25.']
    expected_messages.extend(['@ts-ignore found at line 31.'])
    expected_messages.extend(['Please add a comment above the @ts-ignore explaining the @ts-ignore at line 25. The format of comment should be -> This throws "...". This needs to be suppressed because ...'])
    expected_messages.extend(['Please add a comment above the @ts-ignore explaining the @ts-ignore at line 31. The format of comment should be -> This throws "...". This needs to be suppressed because ...'])
    self.validate(lint_task_report, expected_messages, 1)