Skip to content

Commit a1d9396

Browse files
committed
Apply suggestions from review, remove protected character from describe text
1 parent 73394ff commit a1d9396

File tree

3 files changed

+25
-35
lines changed

3 files changed

+25
-35
lines changed

usage-examples/javascript/mongosh/README.md

Lines changed: 23 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,27 @@ running, and then:
3636
docker ps
3737
```
3838

39-
The output resembles:
39+
The output resembles:
4040

41-
```shell
42-
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
43-
ef70cce38f26 mongo "/usr/local/bin/runn…" 29 hours ago Up 29 hours (healthy) 127.0.0.1:63201->27017/tcp mongodb-test
44-
```
41+
```text
42+
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
43+
ef70cce38f26 mongo "/usr/local/bin/runn…" 29 hours ago Up 29 hours (healthy) 127.0.0.1:63201->27017/tcp mongodb-test
44+
```
45+
46+
You may note the actual port is different than `27017`, if something else is already running on
47+
`27017` on your machine. Note the port next to the IP address for running the tests. Alternately, you can get just
48+
the port info for your container using the following command:
4549

46-
You may note the actual port is different than `27017`, if something else is already running on
47-
`27017` on your machine. Note the port next to the IP address for running the tests.
50+
```shell
51+
docker port mongodb-test
52+
```
53+
54+
The output resembles:
55+
56+
```text
57+
27017/tcp -> 0.0.0.0:27017
58+
27017/tcp -> [::]:27017
59+
```
4860

4961
### Create a .env file
5062

@@ -103,40 +115,18 @@ In the above command:
103115

104116
You can run all the tests in a given test suite (file).
105117

106-
From the `/tests` directory, run:
118+
From the `/mongosh` directory, run:
107119

108120
```
109-
export $(xargs < ../.env) && jest -t '<text string from the 'describe' block you want to run>' --runInBand
121+
npm test -- -t '<text string from the 'describe()' block you want to run>'
110122
```
111123

112-
In the above command:
113-
114-
- `export $(xargs < ../.env)` is Linux flag to make the contents of the `.env`
115-
file available to the test suite
116-
- `jest` is the command to run the test suite
117-
- `-t '<text string from the 'describe' block you want to run>'` is the way to
118-
specify to run all tests in test suite, which in this test, is a single file
119-
- `--runInBand` is a flag that specifies only running one test at a time
120-
to avoid collisions when creating/editing/dropping indexes. Otherwise, Jest
121-
defaults to running tests in parallel.
122-
123124
#### Run Individual Tests from the command line
124125

125126
You can run a single test within a given test suite (file).
126127

127-
From the `/tests` directory, run:
128+
From the `/mongosh` directory, run:
128129

129130
```
130-
export $(xargs < ../.env) && jest -t '<text string from the 'it' block of the test you want to run>'
131+
npm test -- -t '<text string from the 'it()' block you want to run>'
131132
```
132-
133-
In the above command:
134-
135-
- `export $(xargs < ../.env)` is Linux flag to make the contents of the `.env`
136-
file available to the test suite
137-
- `jest` is the command to run the test suite
138-
- `-t '<text string from the 'it' block of the test you want to run>'` is the
139-
way to specify to run a single test matching your text
140-
141-
Since you are only running a single test, there is no chance of colliding
142-
with the other tests, so the `--runInBand` flag isn't needed.

usage-examples/javascript/mongosh/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
},
2121
"scripts": {
2222
"build": "tsc",
23-
"test": "jest --run-in-band --detectOpenHandles"
23+
"test": "jest --runInBand --detectOpenHandles"
2424
},
2525
"devDependencies": {
2626
"@types/jest": "^30.0.0",

usage-examples/javascript/mongosh/tests/aggregation/group.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const unorderedArrayOutputMatches = require("../../utils/unorderedArrayOutputMat
66

77
jest.setTimeout(10000);
88

9-
describe("mongosh $group operator tests", () => {
9+
describe("mongosh group operator tests", () => {
1010
const mongoUri = process.env.CONNECTION_STRING;
1111
const port = process.env.CONNECTION_PORT;
1212
const dbName = "test";

0 commit comments

Comments
 (0)