Skip to content

Commit f6f757b

Browse files
authored
Merge pull request vuejs#25 from mohamedsgap/unit-testing-translation
[DONE]: Translating 'Unit Testing'
2 parents 4c7398e + 7a63f98 commit f6f757b

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/v2/guide/unit-testing.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
2-
title: Unit Testing
2+
title: اختبار الوحدة
33
type: guide
44
order: 402
55
---
66

7-
> [Vue CLI](https://cli.vuejs.org/) has built-in options for unit testing with [Jest](https://github.com/facebook/jest) or [Mocha](https://mochajs.org/) that works out of the box. We also have the official [Vue Test Utils](https://vue-test-utils.vuejs.org/) which provides more detailed guidance for custom setups.
7+
> يحتوي [Vue CLI](https://cli.vuejs.org) على خيارات مدمجة لاختبار الوحدة بـ[Jest](https://github.com/facebook/jest) أو [Mocha](https://mochajs.org/) التي تعمل من خارج المنطقة. لدينا أيضًا [أداة الاختبار Vue](https://vue-test-utils.vuejs.org/) الرسمية الذي يوفر إرشادات أكثر تفصيلًا عن الإعدادات المخصصة.
88
9-
## Simple Assertions
9+
## تحققات بسيطة
1010

11-
You don't have to do anything special in your components to make them testable. Export the raw options:
11+
ليس عليك القيام بأي شيء خاص في مكوناتك لجعلها قابلة للاختبار. تصدير اسطر الخيارات :
1212

1313
``` html
1414
<template>
@@ -29,7 +29,7 @@ You don't have to do anything special in your components to make them testable.
2929
</script>
3030
```
3131

32-
Then import the component options along with Vue, and you can make many common assertions (here we are using Jasmine/Jest style `expect` assertions just as an example):
32+
بعد ذلك قم باستيراد خيارات المكونات مع Vue،ويمكنك تقديم العديد من التحققات الشائعة (هنا نستخدم لتحقق Jasmine/Jest style `expect` فقط كمثال):
3333

3434
``` js
3535
// Import Vue and the component being tested
@@ -67,9 +67,9 @@ describe('MyComponent', () => {
6767
})
6868
```
6969

70-
## Writing Testable Components
70+
## كتابة مكونات قابلة للاختبار
7171

72-
A component's render output is primarily determined by the props it receives. If a component's render output solely depends on its props it becomes straightforward to test, similar to asserting the return value of a pure function with different arguments. Take a simplified example:
72+
يتم تحديد ناتج تصيير المكون في المقام الأول عن طريق "props" او الخصائص التي يتلقاها. إذا كان إخراج التجسيد الخاص بالمكون يعتمد فقط على الخصائص الخاصة به، فسيصبح من السهل اختباره، على غرار تأكيد قيمة الإرجاع للدالة العادية ذات الوسائط المختلفة. خذ مثالا مبسطا:
7373

7474
``` html
7575
<template>
@@ -83,7 +83,7 @@ A component's render output is primarily determined by the props it receives. If
8383
</script>
8484
```
8585

86-
You can assert its render output with different props using the `propsData` option:
86+
يمكنك تأكيد ناتج التصيير باستخدام الخصائص المختلفة باستخدام خيار `propsData`:
8787

8888
``` js
8989
import Vue from 'vue'
@@ -109,9 +109,9 @@ describe('MyComponent', () => {
109109
})
110110
```
111111

112-
## Asserting Asynchronous Updates
112+
## تأكيد التحديثات غير المتزامنة
113113

114-
Since Vue [performs DOM updates asynchronously](reactivity.html#Async-Update-Queue), assertions on DOM updates resulting from state change will have to be made in a `Vue.nextTick` callback:
114+
نظرًا لأن Vue [تنفذ تحديثات DOM بشكل غير متزامن](reactivity.html#Async-Update-Queue)، فيجب إجراء التأكيدات على التحديثات DOM الناتجة عن تغيير الحالة في رد اتصال `Vue.nextTick`:
115115

116116
``` js
117117
// Inspect the generated HTML after a state update
@@ -127,4 +127,4 @@ it('updates the rendered message when vm.message updates', done => {
127127
})
128128
```
129129

130-
For more in-depth information on unit testing in Vue, check out [Vue Test Utils](https://vue-test-utils.vuejs.org/) and our cookbook entry about [unit testing vue components](https://vuejs.org/v2/cookbook/unit-testing-vue-components.html).
130+
لمزيد من المعلومات المتعمقة حول اختبار الوحدة في Vue، تحقق من [Vue Test Utils](https://vue-test-utils.vuejs.org/)، ومدخل (مقدمة) كتاب الطبخ الخاص بنا حول [اختبار الوحدة لمكونات Vue](https://vuejs.org/v2/cookbook/unit-testing-vue-components.html).

0 commit comments

Comments
 (0)