Skip to content

Commit 5f167a2

Browse files
committed
Try doing the conditional import again on UnixTerminal.test.ts
1 parent 0c2944b commit 5f167a2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/unixTerminal.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* Copyright (c) 2018, Microsoft Corporation (MIT License).
44
*/
55

6-
import { UnixTerminal } from './unixTerminal';
76
import * as assert from 'assert';
87
import * as cp from 'child_process';
98
import * as path from 'path';
@@ -12,10 +11,15 @@ import * as fs from 'fs';
1211
import { constants } from 'os';
1312
import { pollUntil } from './testUtils.test';
1413
import { pid } from 'process';
14+
import type { UnixTerminal as UnixTerminalType } from './unixTerminal';
1515

1616
const FIXTURES_PATH = path.normalize(path.join(__dirname, '..', 'fixtures', 'utf8-character.txt'));
1717

1818
if (process.platform !== 'win32') {
19+
// Dynamic require to avoid loading pty.node on Windows
20+
// eslint-disable-next-line @typescript-eslint/naming-convention
21+
const { UnixTerminal } = require('./unixTerminal') as { UnixTerminal: typeof UnixTerminalType };
22+
1923
describe('UnixTerminal', () => {
2024
describe('Constructor', () => {
2125
it('should set a valid pts name', () => {
@@ -75,7 +79,7 @@ if (process.platform !== 'win32') {
7579
});
7680

7781
describe('open', () => {
78-
let term: UnixTerminal;
82+
let term: UnixTerminalType;
7983

8084
afterEach(() => {
8185
if (term) {

0 commit comments

Comments
 (0)