You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Adding tests to be tested with Node-less Runtime](#adding-tests-to-be-tested-with-node-less-runtime)
49
+
-[Running tests in Node-less Runtime](#running-tests-in-node-less-runtime)
50
+
-[Running tests manually in Node-less Runtime](#running-tests-manually-in-node-less-runtime)
46
51
-[GCP](#gcp)
47
52
-[Azure](#azure)
48
53
-[AWS](#aws)
54
+
-[Running tests with TLS](#running-tests-with-tls)
49
55
-[TODO Special Env Sections](#todo-special-env-sections)
50
56
-[Testing driver changes with mongosh](#testing-driver-changes-with-mongosh)
51
57
-[Point mongosh to the driver](#point-mongosh-to-the-driver)
@@ -715,6 +721,64 @@ our existing integration test suite and run Evergreen patches against a single i
715
721
_Note that in cases where the tests need to run longer than one hour to ensure that tokens expire
716
722
that the mocha timeout must be increased in order for the test not to timeout._
717
723
724
+
### Node-less Runtime Testing
725
+
726
+
We are starting to remove explicit Node requirements, and are making it possible for users to provide us with the required functionality.
727
+
728
+
To that end, need to run our tests in a Node-less environment. These tests need to fail if our code erroneously uses Node.
729
+
730
+
#### Design
731
+
732
+
The approach we are taking is to modify our unit and integration tests to run against a patched version of the driver, where any illegal `require` calls are blocked.
733
+
734
+
Here are a few of the relevant components of this system:
735
+
736
+
1. [test/mongodb.ts](test/mongodb.ts)
737
+
- Test entrypoint that exports Driver and all internal types.
738
+
2. [etc/bundle-driver.mjs](etc/bundle-driver.mjs)
739
+
- Creates a CommonJS bundle (Driver and all internal types) from `test/mongodb.ts`.
- Generated "barrel file". It exports either `test/mongodb.ts` (Driver + all internal types) or `test/mongodb_bundled.ts` (Driver + all internal types, loaded from bundle, and using `vm_context_helper.ts` to block `require` calls.)
0 commit comments