Skip to content
This repository was archived by the owner on Oct 5, 2022. It is now read-only.

Commit b11ee60

Browse files
committed
Fix current TS tests
1 parent 80c9100 commit b11ee60

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed
File renamed without changes.

src/unixTerminal.test.ts

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import { UnixTerminal } from './unixTerminal';
22
import * as assert from 'assert';
3-
import pollUntil from 'pollUntil';
3+
import pollUntil = require('pollUntil');
44
import * as tty from 'tty';
5+
import * as path from 'path';
6+
7+
const FIXTURES_PATH = path.normalize(path.join(__dirname, '..', 'fixtures', 'utf8-character.txt'));
58

69
if (process.platform !== 'win32') {
710
describe('UnixTerminal', () => {
@@ -25,15 +28,16 @@ if (process.platform !== 'win32') {
2528

2629
describe('PtyForkEncodingOption', () => {
2730
it('should default to utf8', (done) => {
28-
const term = new UnixTerminal('/bin/bash', [ '-c', 'cat "' + __dirname + '/utf8-character.txt"' ]);
31+
const term = new UnixTerminal('/bin/bash', [ '-c', `cat "${FIXTURES_PATH}"` ]);
2932
term.on('data', (data) => {
33+
console.log('data', data);
3034
assert.equal(typeof data, 'string');
3135
assert.equal(data, '\u00E6');
3236
done();
3337
});
3438
});
3539
it('should return a Buffer when encoding is null', (done) => {
36-
const term = new UnixTerminal(null, [ '-c', 'cat "' + __dirname + '/utf8-character.txt"' ], {
40+
const term = new UnixTerminal('/bin/bash', [ '-c', `cat "${FIXTURES_PATH}"` ], {
3741
encoding: null,
3842
});
3943
term.on('data', (data) => {
@@ -88,7 +92,7 @@ if (process.platform !== 'win32') {
8892
masterbuf += data;
8993
});
9094

91-
pollUntil(() => {
95+
(<any>pollUntil)(() => {
9296
if (masterbuf === 'slave\r\nmaster\r\n' && slavebuf === 'master\n') {
9397
done();
9498
}

0 commit comments

Comments
 (0)