Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:02,220 --> 00:00:05,340
Now with our first custom tests written,
2
00:00:05,340 --> 00:00:07,500
before we write more tests,
3
00:00:07,500 --> 00:00:11,653
let's talk about this tests suites vs. tests thing.
4
00:00:12,690 --> 00:00:14,460
As your application grows,
5
00:00:14,460 --> 00:00:16,120
you typically will have dozens
6
00:00:16,120 --> 00:00:19,540
or maybe hundreds or thousands of tests
7
00:00:19,540 --> 00:00:23,150
and to organize and group those different tests,
8
00:00:23,150 --> 00:00:27,300
you often organize them into different testing suites.
9
00:00:27,300 --> 00:00:31,210
For example, all the tests, belonging to one feature,
10
00:00:31,210 --> 00:00:33,830
or one component of your application,
11
00:00:33,830 --> 00:00:36,123
could be grouped into one testing suite,
12
00:00:37,300 --> 00:00:40,200
and you create such a testing suite,
13
00:00:40,200 --> 00:00:44,150
by using the global "describe" function.
14
00:00:44,150 --> 00:00:48,383
Just like "test," that's a globally available function.
15
00:00:49,240 --> 00:00:51,560
You also give these two arguments,
16
00:00:51,560 --> 00:00:54,410
where the first argument is a description
17
00:00:54,410 --> 00:00:57,320
and this is a description of this category
18
00:00:57,320 --> 00:01:00,630
to which your different tests will then belong,
19
00:01:00,630 --> 00:01:04,730
and here it could be "Greeting," like this,
20
00:01:04,730 --> 00:01:07,660
or "Greeting component"
21
00:01:07,660 --> 00:01:10,210
to make it clear that we're talking about the tests,
22
00:01:10,210 --> 00:01:12,787
belonging to the "Greeting component."
23
00:01:14,220 --> 00:01:15,760
Then you have a second argument,
24
00:01:15,760 --> 00:01:19,100
which also is an anonymous function here.
25
00:01:19,100 --> 00:01:20,160
But in this function
26
00:01:20,160 --> 00:01:23,260
you don't write the testing code itself,
27
00:01:23,260 --> 00:01:26,690
but you put your different tests in there.
28
00:01:26,690 --> 00:01:31,090
So we kept this test and added in this function.
29
00:01:31,090 --> 00:01:32,710
And now we've got one suite
30
00:01:32,710 --> 00:01:34,150
with one test
31
00:01:34,150 --> 00:01:35,950
and we can have multiple suites
32
00:01:35,950 --> 00:01:38,503
and we can also have multiple tests per suite.
33
00:01:39,600 --> 00:01:42,330
So if I now saved this,
34
00:01:42,330 --> 00:01:45,270
you see that we still have this description text,
35
00:01:45,270 --> 00:01:49,120
but it's grouped below this testing group name,
36
00:01:49,120 --> 00:01:51,400
this testing suite name
37
00:01:51,400 --> 00:01:53,810
and you see that we have one testing suite
38
00:01:53,810 --> 00:01:56,120
and one test
39
00:01:56,120 --> 00:01:57,550
The same as before
40
00:01:57,550 --> 00:02:00,670
because if we have no explicitly set suite,
41
00:02:00,670 --> 00:02:02,270
we get one automatically.
42
00:02:02,270 --> 00:02:06,310
But now, we do have our own clearly labeled suite,
43
00:02:06,310 --> 00:02:07,550
which is a good idea.
44
00:02:07,550 --> 00:02:09,250
As your application grows
45
00:02:09,250 --> 00:02:12,423
you definitely want to group your tests like this.
3410
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.