Skip to content

Commit

Permalink
Fix TypesScript test.
Browse files Browse the repository at this point in the history
  • Loading branch information
garg3133 committed Sep 18, 2024
1 parent eeae640 commit e34a9d6
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions test/src/runner/testRunnerTypeScript.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@ describe('testRunnerTypeScript', function() {
let tsNode;

before(function(done) {
tsNode = require('ts-node').register();
tsNode = require('ts-node').register({
esm: false,
// Always compile and execute .ts files as CommonJS,
// even in ESM projects.
moduleTypes: {
'**/*.ts': 'cjs'
}
});

this.server = MockServer.init();
this.server.on('listening', () => {
Expand All @@ -35,8 +42,8 @@ describe('testRunnerTypeScript', function() {
this.timeout(5000);

it('testRunSimple', function() {
let testsPath = path.join(__dirname, '../../sampletests/typescript');
let globals = {
const testsPath = path.join(__dirname, '../../sampletests/typescript');
const globals = {
reporter({lastError, errmessages, modules}) {
if (lastError) {
throw lastError;
Expand Down

0 comments on commit e34a9d6

Please sign in to comment.