From e865a2d63f572e3b3bf3689c7c2c592eb21a7306 Mon Sep 17 00:00:00 2001 From: Jinjiang Date: Tue, 20 Mar 2018 04:24:03 +0800 Subject: [PATCH 1/3] translated cookbook/unit-testing-vue-components.md --- .../cookbook/unit-testing-vue-components.md | 140 +++++++++--------- 1 file changed, 73 insertions(+), 67 deletions(-) diff --git a/src/v2/cookbook/unit-testing-vue-components.md b/src/v2/cookbook/unit-testing-vue-components.md index 4afe8809a..267d1c420 100644 --- a/src/v2/cookbook/unit-testing-vue-components.md +++ b/src/v2/cookbook/unit-testing-vue-components.md @@ -1,14 +1,14 @@ --- -title: Unit Testing Vue Components +title: Vue 组件的单元测试 type: cookbook order: 6 --- -## Simple Example +## 简单的示例 -Unit testing is a fundamental part of software development. Unit tests execute the smallest units of code in isolation, in order to increase ease of adding new features and track down bugs. Vue's [single-file components](./single-file-components.html) make it straight forward to write unit tests for components in isolation. This lets you develop new features with confidence you are not breaking existing ones, and helps other developers understand what your component does. +单元测试是软件开发非常基础的一部分。单元测试会封闭执行最小化单元的代码,使得添加新功能和追踪问题更容易。Vue 的[单文件组件](../guide/single-file-components.html)使得为组件撰写隔离的单元测试这件事更加直接。它会让你带着更强的信心开发新特性而不会打破现有的设计,并帮助其他开发者理解你的组件的工作。 -This simple example tests whether some text is rendered: +这是一个判断一些文本是否被渲染的简单的示例: ```html