Skip to content

Commit cc2a661

Browse files
committed
2 parents 384efcb + 91c055b commit cc2a661

File tree

7 files changed

+9160
-87
lines changed

7 files changed

+9160
-87
lines changed

public/content/.obsidian/workspace

Lines changed: 18 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"main": {
3-
"id": "05143f35c712309f",
3+
"id": "6380036d60ed8668",
44
"type": "split",
55
"children": [
66
{
7-
"id": "4ddedb191ebee436",
7+
"id": "81afcea829cb47b4",
88
"type": "leaf",
99
"state": {
1010
"type": "markdown",
@@ -19,28 +19,28 @@
1919
"direction": "vertical"
2020
},
2121
"left": {
22-
"id": "8ec45541307f5ef4",
22+
"id": "7480b54147d61cf1",
2323
"type": "split",
2424
"children": [
2525
{
26-
"id": "f4fe7402e8a59e81",
26+
"id": "0889bfef5a669ba4",
2727
"type": "tabs",
2828
"children": [
2929
{
30-
"id": "923a99897950ccc0",
30+
"id": "debda34d105c3236",
3131
"type": "leaf",
3232
"state": {
3333
"type": "file-explorer",
3434
"state": {}
3535
}
3636
},
3737
{
38-
"id": "0934f83fb030564f",
38+
"id": "c8e33c270b4c2eb8",
3939
"type": "leaf",
4040
"state": {
4141
"type": "search",
4242
"state": {
43-
"query": "perennial",
43+
"query": "",
4444
"matchingCase": false,
4545
"explainSearch": false,
4646
"collapseAll": false,
@@ -53,18 +53,18 @@
5353
}
5454
],
5555
"direction": "horizontal",
56-
"width": 242
56+
"width": 300
5757
},
5858
"right": {
59-
"id": "7af2073755a9070d",
59+
"id": "61a0a2678a769da1",
6060
"type": "split",
6161
"children": [
6262
{
63-
"id": "b94dd857eff32eec",
63+
"id": "1e946925308e5563",
6464
"type": "tabs",
6565
"children": [
6666
{
67-
"id": "7df5605f17477e7d",
67+
"id": "c8e5d13edaaa6afd",
6868
"type": "leaf",
6969
"state": {
7070
"type": "backlink",
@@ -76,12 +76,12 @@
7676
"showSearch": false,
7777
"searchQuery": "",
7878
"backlinkCollapsed": false,
79-
"unlinkedCollapsed": false
79+
"unlinkedCollapsed": true
8080
}
8181
}
8282
},
8383
{
84-
"id": "62d006fd5d1f1c77",
84+
"id": "28097daee73bfd71",
8585
"type": "leaf",
8686
"state": {
8787
"type": "outgoing-link",
@@ -93,7 +93,7 @@
9393
}
9494
},
9595
{
96-
"id": "8aad5b2f9d2ce7f1",
96+
"id": "9e5be617c000e515",
9797
"type": "leaf",
9898
"state": {
9999
"type": "tag",
@@ -104,7 +104,7 @@
104104
}
105105
},
106106
{
107-
"id": "ba1623fb0390f1d1",
107+
"id": "81085b5b8b930f83",
108108
"type": "leaf",
109109
"state": {
110110
"type": "outline",
@@ -113,25 +113,16 @@
113113
}
114114
}
115115
}
116-
],
117-
"currentTab": 3
116+
]
118117
}
119118
],
120119
"direction": "horizontal",
121120
"width": 300,
122121
"collapsed": true
123122
},
124-
"active": "4ddedb191ebee436",
123+
"active": "81afcea829cb47b4",
125124
"lastOpenFiles": [
126125
"javascript/testing-javascript/6-Testing-React-Components-With-Jest-And-React-Testing-Library.md",
127-
"javascript/testing-javascript/5-Configure-Jest-For-Testing-JS-Apps.md",
128-
"books/Four-Thousand-Weeks.md",
129-
"books/Books.md",
130-
"javascript/testing-javascript/4-Using-DOM-Testing-Library-to-test-any-JS-framework.md",
131-
"javascript/testing-javascript/3-Static-Analysis-Testing-JavaScript-Applications.md",
132-
"javascript/testing-javascript/2-JavaScript-Mocking-Fundamentals.md",
133-
"computer-systems/Computer-Systems.md",
134-
"computer-systems/a-programmers-perspective/A-Programmers-Perspective.md",
135-
"computer-systems/a-programmers-perspective/1-A-Tour-Of-Computer-Systems/Buses.md"
126+
"javascript/testing-javascript/5-Configure-Jest-For-Testing-JS-Apps.md"
136127
]
137128
}
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
{
2+
"main": {
3+
"id": "05143f35c712309f",
4+
"type": "split",
5+
"children": [
6+
{
7+
"id": "4ddedb191ebee436",
8+
"type": "leaf",
9+
"state": {
10+
"type": "markdown",
11+
"state": {
12+
"file": "javascript/testing-javascript/6-Testing-React-Components-With-Jest-And-React-Testing-Library.md",
13+
"mode": "source",
14+
"source": false
15+
}
16+
}
17+
}
18+
],
19+
"direction": "vertical"
20+
},
21+
"left": {
22+
"id": "8ec45541307f5ef4",
23+
"type": "split",
24+
"children": [
25+
{
26+
"id": "f4fe7402e8a59e81",
27+
"type": "tabs",
28+
"children": [
29+
{
30+
"id": "923a99897950ccc0",
31+
"type": "leaf",
32+
"state": {
33+
"type": "file-explorer",
34+
"state": {}
35+
}
36+
},
37+
{
38+
"id": "0934f83fb030564f",
39+
"type": "leaf",
40+
"state": {
41+
"type": "search",
42+
"state": {
43+
"query": "perennial",
44+
"matchingCase": false,
45+
"explainSearch": false,
46+
"collapseAll": false,
47+
"extraContext": false,
48+
"sortOrder": "alphabetical"
49+
}
50+
}
51+
}
52+
]
53+
}
54+
],
55+
"direction": "horizontal",
56+
"width": 242
57+
},
58+
"right": {
59+
"id": "7af2073755a9070d",
60+
"type": "split",
61+
"children": [
62+
{
63+
"id": "b94dd857eff32eec",
64+
"type": "tabs",
65+
"children": [
66+
{
67+
"id": "7df5605f17477e7d",
68+
"type": "leaf",
69+
"state": {
70+
"type": "backlink",
71+
"state": {
72+
"file": "javascript/testing-javascript/6-Testing-React-Components-With-Jest-And-React-Testing-Library.md",
73+
"collapseAll": false,
74+
"extraContext": false,
75+
"sortOrder": "alphabetical",
76+
"showSearch": false,
77+
"searchQuery": "",
78+
"backlinkCollapsed": false,
79+
"unlinkedCollapsed": false
80+
}
81+
}
82+
},
83+
{
84+
"id": "62d006fd5d1f1c77",
85+
"type": "leaf",
86+
"state": {
87+
"type": "outgoing-link",
88+
"state": {
89+
"file": "javascript/testing-javascript/6-Testing-React-Components-With-Jest-And-React-Testing-Library.md",
90+
"linksCollapsed": false,
91+
"unlinkedCollapsed": true
92+
}
93+
}
94+
},
95+
{
96+
"id": "8aad5b2f9d2ce7f1",
97+
"type": "leaf",
98+
"state": {
99+
"type": "tag",
100+
"state": {
101+
"sortOrder": "frequency",
102+
"useHierarchy": true
103+
}
104+
}
105+
},
106+
{
107+
"id": "ba1623fb0390f1d1",
108+
"type": "leaf",
109+
"state": {
110+
"type": "outline",
111+
"state": {
112+
"file": "javascript/testing-javascript/6-Testing-React-Components-With-Jest-And-React-Testing-Library.md"
113+
}
114+
}
115+
}
116+
],
117+
"currentTab": 3
118+
}
119+
],
120+
"direction": "horizontal",
121+
"width": 300,
122+
"collapsed": true
123+
},
124+
"active": "4ddedb191ebee436",
125+
"lastOpenFiles": [
126+
"javascript/testing-javascript/6-Testing-React-Components-With-Jest-And-React-Testing-Library.md",
127+
"javascript/testing-javascript/5-Configure-Jest-For-Testing-JS-Apps.md",
128+
"books/Four-Thousand-Weeks.md",
129+
"books/Books.md",
130+
"javascript/testing-javascript/4-Using-DOM-Testing-Library-to-test-any-JS-framework.md",
131+
"javascript/testing-javascript/3-Static-Analysis-Testing-JavaScript-Applications.md",
132+
"javascript/testing-javascript/2-JavaScript-Mocking-Fundamentals.md",
133+
"computer-systems/Computer-Systems.md",
134+
"computer-systems/a-programmers-perspective/A-Programmers-Perspective.md",
135+
"computer-systems/a-programmers-perspective/1-A-Tour-Of-Computer-Systems/Buses.md"
136+
]
137+
}

public/content/javascript/testing-javascript/5-Configure-Jest-For-Testing-JS-Apps.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,25 +29,25 @@ The common configuration was put in a file `test/jest-common.js` while new files
2929
In `test/jest.server.js`:
3030

3131
```js
32-
const path = require("path");
32+
const path = require('path')
3333
module.exports = {
34-
...require("./jest-common"),
35-
coverageDirectory: path.join(__dirname, "../coverage/server"),
36-
testEnvironment: "test-environment-node",
37-
testMath: ["**/__server_tests__/**/*.js"],
38-
};
34+
...require('./jest-common'),
35+
coverageDirectory: path.join(__dirname, '../coverage/server'),
36+
testEnvironment: 'test-environment-node',
37+
testMath: ['**/__server_tests__/**/*.js'],
38+
}
3939
```
4040

4141
In `test/jest.client.js`:
4242

4343
```js
44-
const path = require("path");
44+
const path = require('path')
4545
module.exports = {
46-
...require("./jest-common"),
47-
testEnvironment: "jest-environment-jsdom",
48-
setupFilesAfterEnv: ["..."],
46+
...require('./jest-common'),
47+
testEnvironment: 'jest-environment-jsdom',
48+
setupFilesAfterEnv: ['...'],
4949
// ... The rest is added
50-
};
50+
}
5151
```
5252

5353
Now when running tests, you need to specify the path to the correct config.
@@ -67,11 +67,11 @@ Inside of this, we can add the following:
6767

6868
```js
6969
module.exports = {
70-
...require("./test/jest-common"),
70+
...require('./test/jest-common'),
7171
// ... other configuration standards
7272
// ...
73-
projects: ["./test/jest.client.js", "./test/jest.server.js"],
74-
};
73+
projects: ['./test/jest.client.js', './test/jest.server.js'],
74+
}
7575
```
7676

7777
This will run all the tests from the different projects with totally different configurations.
@@ -101,9 +101,9 @@ This needs to be added to the watch plugins:
101101
```js
102102
watchPlugins: [
103103
// others ...
104-
"jest-watch-typeahead/filename",
105-
"jest-watch-typeahead/testname",
106-
];
104+
'jest-watch-typeahead/filename',
105+
'jest-watch-typeahead/testname',
106+
]
107107
```
108108

109109
We then get a list of the files that match the output and we can head type and run those specific files. The same can be for the names of the tests.

0 commit comments

Comments
 (0)