Skip to content

Commit 3c18496

Browse files
authored
Merge branch 'master' into 1.10.1
2 parents b455545 + c874622 commit 3c18496

File tree

423 files changed

+11560
-9905
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

423 files changed

+11560
-9905
lines changed

1-js/01-getting-started/4-devtools/article.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Otevřou se vývojářské nástroje na záložce „Console“.
2222

2323
Budou vypadat zhruba takto:
2424

25-
![chrome](chrome.png)
25+
![chrome](chrome.webp)
2626

2727
Vzhled vývojářských nástrojů závisí na vaší verzi Chrome. Čas od času se mění, ale měl by se podobat obrázku.
2828

@@ -49,8 +49,8 @@ Jejich vzhled je vcelku podobný. Až budete vědět, jak používat nástroje v
4949

5050
Safari (prohlížeč pro Mac, není podporován ve Windows nebo Linuxu) je v tomto ohledu trochu zvláštní. Nejprve musíme povolit „menu Vývoj“.
5151

52-
Otevřete „Preferences“ a jděte na záložku „Advanced“. Dole uvidíte checkbox, který zaškrtněte:
53-
52+
Otevřete „Settings“ a jděte na záložku „Advanced“. Dole uvidíte checkbox, který zaškrtněte:
53+
5454
![safari](safari.png)
5555

5656
Nyní můžete zapínat konzoli pomocí `key:Cmd+Opt+C`. Všimněte si také, že v horním menu se objevila nová položka s názvem „Develop“ („Vývoj“), která obsahuje mnoho příkazů a nastavení.
-41.1 KB
Binary file not shown.
22.2 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
83 KB
Loading
Loading

1-js/02-first-steps/16-function-expressions/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ let řekniAhoj = function() { // (1) vytvoření
8282
alert( "Ahoj" );
8383
};
8484

85-
let funkce = řekniAhoj;
85+
let funkce = řekniAhoj; // (2)
8686
// ...
8787
```
8888

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,50 @@
1-
The test demonstrates one of the temptations a developer meets when writing tests.
1+
Tento test ukazuje jedno z pokušení, kterým vývojář při psaní testů čelí.
22

3-
What we have here is actually 3 tests, but layed out as a single function with 3 asserts.
3+
To, co zde máme, jsou ve skutečnosti 3 testy, ale jsou vytvořeny jako jediná funkce se 3 kontrolami.
44

5-
Sometimes it's easier to write this way, but if an error occurs, it's much less obvious what went wrong.
5+
Někdy je jednodušší psát takto, ale když nastane chyba, je mnohem méně zřejmé, co bylo špatně.
66

7-
If an error happens in the middle of a complex execution flow, then we'll have to figure out the data at that point. We'll actually have to *debug the test*.
7+
Nastane-li chyba uprostřed složitého provádění, musíme v té chvíli zjišťovat, jaká byla data. Vlastně musíme *ladit test*.
88

9-
It would be much better to break the test into multiple `it` blocks with clearly written inputs and outputs.
9+
Bylo by mnohem lepší rozdělit test do několika `it` bloků s jasně uvedenými vstupy a výstupy.
1010

11-
Like this:
11+
Například takto:
1212
```js
13-
describe("Raises x to power n", function() {
14-
it("5 in the power of 1 equals 5", function() {
15-
assert.equal(pow(5, 1), 5);
13+
describe("Umocní x na n-tou", function() {
14+
it("5 na 1 se rovná 5", function() {
15+
assert.equal(mocnina(5, 1), 5);
1616
});
1717

18-
it("5 in the power of 2 equals 25", function() {
19-
assert.equal(pow(5, 2), 25);
18+
it("5 na 2 se rovná 25", function() {
19+
assert.equal(mocnina(5, 2), 25);
2020
});
2121

22-
it("5 in the power of 3 equals 125", function() {
23-
assert.equal(pow(5, 3), 125);
22+
it("5 na 3 se rovná 125", function() {
23+
assert.equal(mocnina(5, 3), 125);
2424
});
2525
});
2626
```
2727

28-
We replaced the single `it` with `describe` and a group of `it` blocks. Now if something fails we would see clearly what the data was.
28+
Nahradili jsme jediné `it` za `describe` a skupinu `it` bloků. Když nyní něco selže, jasně uvidíme, jaká byla data.
2929

30-
Also we can isolate a single test and run it in standalone mode by writing `it.only` instead of `it`:
30+
Nyní můžeme také izolovat jediný test a spustit jej samostatně. To uděláme tak, že napíšeme `it.only` místo `it`:
3131

3232

3333
```js
34-
describe("Raises x to power n", function() {
35-
it("5 in the power of 1 equals 5", function() {
36-
assert.equal(pow(5, 1), 5);
34+
describe("Umocní x na n-tou", function() {
35+
it("5 na 1 se rovná 5", function() {
36+
assert.equal(mocnina(5, 1), 5);
3737
});
3838

3939
*!*
40-
// Mocha will run only this block
41-
it.only("5 in the power of 2 equals 25", function() {
42-
assert.equal(pow(5, 2), 25);
40+
// Mocha spustí pouze tento blok
41+
it.only("5 na 2 se rovná 25", function() {
42+
assert.equal(mocnina(5, 2), 25);
4343
});
4444
*/!*
4545

46-
it("5 in the power of 3 equals 125", function() {
47-
assert.equal(pow(5, 3), 125);
46+
it("5 na 3 se rovná 125", function() {
47+
assert.equal(mocnina(5, 3), 125);
4848
});
4949
});
5050
```

1-js/03-code-quality/05-testing-mocha/3-pow-test-wrong/task.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@ importance: 5
22

33
---
44

5-
# What's wrong in the test?
5+
# Co je na tomto testu špatně?
66

7-
What's wrong in the test of `pow` below?
7+
Co je špatně na níže uvedeném testu funkce `mocnina`?
88

99
```js
10-
it("Raises x to the power n", function() {
10+
it("Umocní x na n-tou", function() {
1111
let x = 5;
1212

13-
let result = x;
14-
assert.equal(pow(x, 1), result);
13+
let výsledek = x;
14+
assert.equal(mocnina(x, 1), výsledek);
1515

16-
result *= x;
17-
assert.equal(pow(x, 2), result);
16+
výsledek *= x;
17+
assert.equal(mocnina(x, 2), výsledek);
1818

19-
result *= x;
20-
assert.equal(pow(x, 3), result);
19+
výsledek *= x;
20+
assert.equal(mocnina(x, 3), výsledek);
2121
});
2222
```
2323

24-
P.S. Syntactically the test is correct and passes.
24+
P.S. Syntakticky je tento test korektní a projde.

0 commit comments

Comments
 (0)