Skip to content

Conversation

Anemy
Copy link
Member

@Anemy Anemy commented Feb 20, 2025

COMPASS-8890

Adds a test that analyzes documents, creates a mongodb validation rule, tries inserting valid and invalid docs against it.

"reservoir": "^0.1.2"
},
"devDependencies": {
"@mongodb-js/compass-test-server": "^0.3.2",
Copy link
Member Author

@Anemy Anemy Feb 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mocha test setup and teardown when using mongodb-runner has some needed boiler plate to make it cleanup correctly. In Compass we do this in compass-test-server https://github.com/mongodb-js/compass/blob/main/packages/compass-test-server/src/index.ts .
I'm thinking it would be useful to have these helpers here in mongodb-schema.

Would it make sense to move the test-server-runner to devtools-shared? Or should we just copy over that mocha test code to here instead? Or we just include this import as-is and then we can do those changes down the line if we feel it's needed.

I'm likely going to merge this as is, as it's just for testing. Let me know what y'all think. I think if we get another place doing mongodb-runner test setup/teardown in mocha functions then let's move it out of compass.

@Anemy Anemy merged commit 262ffb8 into main Feb 26, 2025
20 checks passed
@Anemy Anemy deleted the COMPASS-8890 branch February 26, 2025 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants