Skip to content

Commit 5d65c31

Browse files
agusIDresir014
authored andcommitted
Translate Testing Overview (#116)
* Translate docs/testing * Whoops, fix typo * resolve request change
1 parent 2715e98 commit 5d65c31

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

content/docs/testing.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,34 +7,34 @@ redirect_from:
77
next: testing-recipes.html
88
---
99

10-
You can test React components similar to testing other JavaScript code.
10+
Anda dapat mengetes komponen React mirip dengan mengetes kode JavaScript lainnya.
1111

12-
There are a few ways to test React components. Broadly, they divide into two categories:
12+
Ada beberapa cara untuk mengeteskomponen pada React. Secara umum, terbagi menjadi dua kategori:
1313

14-
* **Rendering component trees** in a simplified test environment and asserting on their output.
15-
* **Running a complete app** in a realistic browser environment (also known as “end-to-end” tests).
14+
* **_Rendering component trees_** di dalam _environment_ tes yang sudah disederhanakan dan ditegaskan pada keluarannya.
15+
* **Menjalankan aplikasi lengkap** di dalam _environment_ peramban asli (juga dikenal sebagai tes “end-to-end”).
1616

17-
This documentation section focuses on testing strategies for the first case. While full end-to-end tests can be very useful to prevent regressions to important workflows, such tests are not concerned with React components in particular, and are out of scope of this section.
17+
Bagian dokumentasi ini berfokus pada strategi tes untuk kasus pertama. Sementara tes _end-to-end_ secara menyeluruh bisa sangat berguna untuk mencegah regresi terhadap alur kerja yang penting, tes semacam itu tidak diperhatikan terutama pada komponen React, dan berada di luar cakupan bagian ini.
1818

19-
### Tradeoffs {#tradeoffs}
19+
### _Tradeoffs_ {#tradeoffs}
2020

2121

22-
When choosing testing tools, it is worth considering a few tradeoffs:
22+
Saat memilih kakas pengetesan, perlu mempertimbangkan beberapa _tradeoffs_:
2323

24-
* **Iteration speed vs Realistic environment:** Some tools offer a very quick feedback loop between making a change and seeing the result, but don't model the browser behavior precisely. Other tools might use a real browser environment, but reduce the iteration speed and are flakier on a continuous integration server.
25-
* **How much to mock:** With components, the distinction between a "unit" and "integration" test can be blurry. If you're testing a form, should its test also test the buttons inside of it? Or should a button component have its own test suite? Should refactoring a button ever break the form test?
24+
* **Kecepatan iterasi vs _environment_ yang realistis:** Beberapa kakas menawarkan _feedback loop_ yang sangat cepat antara membuat sebuah perubahan dan melihat hasilnya, tetapi tidak memodelkan sifat dari peramban dengan tepat. _Tools_ lain mungkin menggunakan _environment_ peramban yang asli, tetapi mengurangi kecepatan iterasi dan lebih _flakier_ pada server integrasi berkelanjutan.
25+
* **Seberapa banyak _mock_:** Dengan komponen, perbedaan antara tes "unit" dan tes "integrasi" bisa tidak sesuai. Jika Anda mengetes sebuah form, haruskah tes yang dilakukan juga menguji tombol yang ada di dalamnya? Atau haruskah komponen memiliki rangkaian tes sendiri? Haruskah _refactoring_ pada tombol merusak tes pada form?
2626

27-
Different answers may work for different teams and products.
27+
Jawaban yang berbeda mungkin berlaku untuk tim dan produk yang berbeda.
2828

29-
### Recommended Tools {#tools}
29+
### Kakas yang direkomendasikan {#tools}
3030

31-
**[Jest](https://facebook.github.io/jest/)** is a JavaScript test runner that lets you access the DOM via [`jsdom`](/docs/testing-environments.html#mocking-a-rendering-surface). While jsdom is only an approximation of how the browser works, it is often good enough for testing React components. Jest provides a great iteration speed combined with powerful features like mocking [modules](/docs/testing-environments.html#mocking-modules) and [timers](/docs/testing-environments.html#mocking-timers) so you can have more control over how the code executes.
31+
**[Jest](https://facebook.github.io/jest/)** adalah _test runner_ pada JavaScript yang memungkinkan Anda mengakses DOM melalui [`jsdom`](/docs/testing-environments.html#mocking-a-rendering-surface). Sementara jsdom hanyalah perkiraan cara kerja browser, seringkali cukup baik mengetes komponen pada React. Jest memberikan kecepatan iterasi yang bagus dikombinasikan dengan fitur-fitur yang _powerful_ seperti _mocking [modules](/docs/testing-environments.html#mocking-modules)_ dan _[timers](/docs/testing-environments.html#mocking-timers)_ sehingga Anda dapat memiliki kontrol lebih pada kode yang dijalankan.
3232

33-
**[React Testing Library](https://testing-library.com/react)** is a set of helpers that let you test React components without relying on their implementation details. This approach makes refactoring a breeze and also nudges you towards best practices for accessibility. Although it doesn't provide a way to "shallowly" render a component without its children, a test runner like Jest lets you do this by [mocking](/docs/testing-recipes.html#mocking-modules).
33+
**[React Testing Library](https://testing-library.com/react)** adalah seperangkat _helpers_ yang memungkinkan Anda mengetes komponen pada React tanpa bergantung pada detail implementasinya. Pendekatan ini membuat _refactoring_ menjadi mudah dan juga mendorong Anda untuk menerapkan _best practices_ untuk aksesbilitas. Mungkin tidak memberikan cara untuk me-_render_ secara "dangkal" pada sebuah komponen tanpa anak, _test runner_ seperti Jest yang memungkinkan Anda melakukan [mocking](/docs/testing-recipes.html#mocking-modules).
3434

35-
### Learn More {#learn-more}
35+
### Pembelajaran lainnya {#learn-more}
3636

37-
This section is divided in two pages:
37+
Bagian ini terbagi dalam dua halaman:
3838

39-
- [Recipes](/docs/testing-recipes.html): Common patterns when writing tests for React components.
40-
- [Environments](/docs/testing-environments.html): What to consider when setting up a testing environment for React components.
39+
- [_Recipes_](/docs/testing-recipes.html): Pola yang sering dijumpai pada saat menulis tes pada komponen React.
40+
- [_Environments_](/docs/testing-environments.html): Apa yang harus dipertimbangkan ketika menyiapkan _environment_ tes untuk komponen React.

0 commit comments

Comments
 (0)