Skip to content

Commit 026ba8a

Browse files
committed
Fix tty issue
1 parent 523fb01 commit 026ba8a

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/subprocess/thread/worker.development.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,5 @@
22
// eslint-disable-next-line @typescript-eslint/no-var-requires
33
const { register: registerTypescriptHandler } = require('ts-node');
44

5-
// monkeypatch Node.JS native TTY function
6-
// otherwise mocha native base reporter throws exception
7-
// inside a worker environment
8-
require('tty').getWindowSize = () => 75;
9-
105
registerTypescriptHandler();
116
require(`${__dirname}/worker.ts`);

src/subprocess/thread/worker.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
import { workerData } from 'worker_threads';
1+
// monkeypatch Node.JS native TTY function
2+
// otherwise mocha native base reporter throws exception
3+
// inside a worker environment
4+
require('tty').getWindowSize = () => 75;
25

6+
import { workerData } from 'worker_threads';
37
import { runMocha } from '../runner';
48
import { WorkerData } from '../../main/thread/worker';
59

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
Check that spec reporter can work in a non-TTY window
2+
TODO: this test fails when you run index.js from the terminal but doesn't fail when it's executed from tests/index.sh

0 commit comments

Comments
 (0)