-
Notifications
You must be signed in to change notification settings - Fork 5
Mongosh test suite PoC #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 excited for this!
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
export
since it's not needed -- the setup already handles it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like this will help enforce using standardized sample data across examples too
Co-authored-by: Cory <115956901+cbullinger@users.noreply.github.com>
This PR moves the existing JavaScript Node.js test suite into a
driver
directory, and adds a secondmongosh
directory under JavaScript with a PoC for testingmongosh
code 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.