Skip to content

Commit

Permalink
use dynamic import for chai
Browse files Browse the repository at this point in the history
Change-Id: If187558c8d4df1cfeed88df81011ba358739d851
  • Loading branch information
bpedersen2 committed Nov 14, 2024
1 parent 8e7d18d commit e5233de
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/config/pretest.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
//NOTE: Here we load and initialize some global variables that are used throughout the tests
require("dotenv").config();
var chaiHttp = require("chai-http");
var chai;

const { MongoClient } = require("mongodb");

const client = new MongoClient(process.env.MONGODB_URI);

async function loadChai() {

var chai=require('chai');
use(chaiHttp);
await import("chai").then((result) => {
chai = result.use(chaiHttp);
});
await client.connect();
}

Expand Down

0 comments on commit e5233de

Please sign in to comment.