def test_compiled_js_dir_is_deleted_before_watch_mode_compilation(self):
    'Test that compiled_js_dir is deleted before a fresh watch mode\n        compilation.\n        '

    def mock_call(unused_cmd, shell, stdout):
        pass

    def mock_popen(unused_cmd, stdout):
        pass

    def mock_require_compiled_js_dir_to_be_valid():
        pass
    with self.swap(build, 'COMPILED_JS_DIR', MOCK_COMPILED_JS_DIR), self.swap(build, 'require_compiled_js_dir_to_be_valid', mock_require_compiled_js_dir_to_be_valid):
        if (not os.path.exists(os.path.dirname(MOCK_COMPILED_JS_DIR))):
            os.mkdir(os.path.dirname(MOCK_COMPILED_JS_DIR))
        with self.swap(subprocess, 'Popen', mock_popen), self.swap(subprocess, 'call', mock_call), self.swap(build, 'TSC_OUTPUT_LOG_FILEPATH', MOCK_TSC_OUTPUT_LOG_FILEPATH):
            build.compile_typescript_files_continuously('.')
            self.assertFalse(os.path.exists(os.path.dirname(MOCK_COMPILED_JS_DIR)))
Test that compiled_js_dir is deleted before a fresh watch mode
compilation.
def test_compiled_js_dir_is_deleted_before_watch_mode_compilation(self):
    'Test that compiled_js_dir is deleted before a fresh watch mode\n        compilation.\n        '

    def mock_call(unused_cmd, shell, stdout):
        pass

    def mock_popen(unused_cmd, stdout):
        pass

    def mock_require_compiled_js_dir_to_be_valid():
        pass
    with self.swap(build, 'COMPILED_JS_DIR', MOCK_COMPILED_JS_DIR), self.swap(build, 'require_compiled_js_dir_to_be_valid', mock_require_compiled_js_dir_to_be_valid):
        if (not os.path.exists(os.path.dirname(MOCK_COMPILED_JS_DIR))):
            os.mkdir(os.path.dirname(MOCK_COMPILED_JS_DIR))
        with self.swap(subprocess, 'Popen', mock_popen), self.swap(subprocess, 'call', mock_call), self.swap(build, 'TSC_OUTPUT_LOG_FILEPATH', MOCK_TSC_OUTPUT_LOG_FILEPATH):
            build.compile_typescript_files_continuously('.')
            self.assertFalse(os.path.exists(os.path.dirname(MOCK_COMPILED_JS_DIR)))