-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
50863a7
commit b344423
Showing
6 changed files
with
190 additions
and
133 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ import { ReportingAPIForTesting } from "../agent/api/ReportingAPIForTesting"; | |
import { Context, runWithContext } from "../agent/Context"; | ||
import { LoggerNoop } from "../agent/logger/LoggerNoop"; | ||
import { MongoDB } from "./MongoDB"; | ||
import { isCJS } from "../helpers/isCJS"; | ||
|
||
const unsafeContext: Context = { | ||
remoteAddress: "::1", | ||
|
@@ -41,11 +42,14 @@ t.test("it inspects method calls and blocks if needed", async (t) => { | |
new LoggerNoop(), | ||
new ReportingAPIForTesting(), | ||
undefined, | ||
"lambda" | ||
"lambda", | ||
!isCJS() | ||
); | ||
agent.start([new MongoDB()]); | ||
|
||
const { MongoClient } = require("mongodb"); | ||
const { MongoClient } = isCJS() | ||
? require("mongodb") | ||
: await import("mongodb"); | ||
const client = new MongoClient("mongodb://root:[email protected]:27017"); | ||
await client.connect(); | ||
|
||
|
Oops, something went wrong.