Skip to content

Commit

Permalink
Fix flaky disable_typescript flag test. (#3865)
Browse files Browse the repository at this point in the history
  • Loading branch information
garg3133 authored Aug 9, 2023
1 parent 904b97f commit c89e346
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions test/src/runner/testRunnerMixedFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ describe('testRunnerMixedFiles', function() {
let tsNode;

before(function(done) {
tsNode = require('ts-node').register();
tsNode = require('ts-node').register({
project: path.resolve('tsconfig.json'),
swc: true
});

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

it('testRunWithoutDisablingTypescriptExplicitly', function() {
let testsPath = path.join(__dirname, '../../sampletests/mixed-files');
let globals = {
const testsPath = path.join(__dirname, '../../sampletests/mixed-files');
const globals = {
reporter({lastError, errmessages, modules}) {
if (lastError) {
throw lastError;
Expand All @@ -45,7 +48,7 @@ describe('testRunnerMixedFiles', function() {
if (errmessages.length) {
throw new Error(errmessages[0]);
}

assert.ok('sampleJs' in modules);
assert.ok('sampleTs' in modules);
assert.strictEqual(modules['sampleJs'].modulePath, path.join(__dirname, '../../sampletests/mixed-files/sampleJs.js'));
Expand All @@ -62,8 +65,8 @@ describe('testRunnerMixedFiles', function() {
});

it('testRunWithoutDisablingTypescriptImplicitly', function() {
let testsPath = path.join(__dirname, '../../sampletests/mixed-files');
let globals = {
const testsPath = path.join(__dirname, '../../sampletests/mixed-files');
const globals = {
reporter({lastError, errmessages, modules}) {
if (lastError) {
throw lastError;
Expand All @@ -87,8 +90,8 @@ describe('testRunnerMixedFiles', function() {
});

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

0 comments on commit c89e346

Please sign in to comment.