Merged
Conversation
cbullinger
approved these changes
Jun 25, 2025
| operations that remain open after the tests are complete. These can cause the test suite | ||
| to hang, and this flag tells Jest to report info about these instances. | ||
|
|
||
| #### Run Test Suites from the command line |
Collaborator
There was a problem hiding this comment.
why aren't we using npm scripts here? would let us simplify these last sections to running the following from /mongosh root without requiring jest installed:
npm test -- -t '<text string from the 'describe()' block you want to run>'
or
npm test -- -t '<text string from the 'it()' block you want to run>'
...if we do keep them as a jest commands, we should:
- add jest install to prereqs (
npm install -g jest) - drop the
exportsince it's not needed -- the setup already handles it
Collaborator
Author
There was a problem hiding this comment.
Good call! I did not know this was an option 😅 Updated!
| const port = process.env.CONNECTION_PORT; | ||
| const dbName = "test"; | ||
|
|
||
| // Load test data before running the tests |
Collaborator
There was a problem hiding this comment.
seems like this will help enforce using standardized sample data across examples too
Co-authored-by: Cory <115956901+cbullinger@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR moves the existing JavaScript Node.js test suite into a
driverdirectory, and adds a secondmongoshdirectory under JavaScript with a PoC for testingmongoshcode examples with Jest.After some trial and error, I found the best way to execute the existing code examples with minimal modification was to use the Execute a Script from the Command Line option from the mongosh docs.
This PoC tests the code examples on the $group reference page.