Skip to content

Commit ecbd379

Browse files
committed
Update TypeScript
Mockttp now exposes some types that use Omit, so we need at least 3.5+. Good to do anyway, although it required a couple of other changes en route.
1 parent 9667ebf commit ecbd379

File tree

7 files changed

+40
-29
lines changed

7 files changed

+40
-29
lines changed

pack.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const OUTPUT_DIR = path.join(__dirname, 'build');
77

88
const pjson = require(path.join(__dirname, './package.json'));
99

10-
const spawn = (command: string, args: string[] = [], options?: SpawnOptions) => {
10+
const spawn = (command: string, args: string[] = [], options: SpawnOptions = {}) => {
1111
return new Promise((resolve, reject) => {
1212
const proc = spawnAsync(command, args, options);
1313
proc.on('exit', (code) => {

package-lock.json

Lines changed: 29 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"@types/fs-extra": "^8.0.0",
6161
"@types/lodash": "^4.14.117",
6262
"@types/mocha": "^5.2.5",
63-
"@types/node": "^10.12.0",
63+
"@types/node": "^12.7.9",
6464
"@types/request-promise-native": "^1.0.15",
6565
"@types/rimraf": "^2.0.2",
6666
"@types/tmp": "0.0.33",
@@ -85,8 +85,8 @@
8585
"tarball-extract": "0.0.6",
8686
"tmp": "0.0.33",
8787
"ts-loader": "^6.0.0",
88-
"ts-node": "^7.0.1",
89-
"typescript": "^3.1.3",
88+
"ts-node": "^8.4.1",
89+
"typescript": "^3.6.3",
9090
"uglifyjs-webpack-plugin": "^2.2.0",
9191
"unirest": "^0.6.0",
9292
"webpack": "^4.40.2",

src/error-tracking.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export function initErrorTracking() {
7171
};
7272

7373
addBreadcrumb('Spawning process', { data: { command, args, options: sanitizedOptions } });
74-
return rawSpawn.apply(this, arguments);
74+
return rawSpawn.apply(this, arguments as any);
7575
};
7676

7777
sentryInitialized = true;

src/interceptors/fresh-chrome.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ export class FreshChrome implements Interceptor {
6767
]
6868
}, this.config.configPath);
6969

70-
browser.process.stdout.pipe(process.stdout);
71-
browser.process.stderr.pipe(process.stderr);
70+
if (browser.process.stdout) browser.process.stdout.pipe(process.stdout);
71+
if (browser.process.stderr) browser.process.stderr.pipe(process.stderr);
7272

7373
await hideWarningServer.completedPromise;
7474
await hideWarningServer.stop();

src/interceptors/fresh-firefox.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ export class FreshFirefox implements Interceptor {
119119
})
120120
}, this.config.configPath);
121121

122-
browser.process.stdout.pipe(process.stdout);
123-
browser.process.stderr.pipe(process.stderr);
122+
if (browser.process.stdout) browser.process.stdout.pipe(process.stdout);
123+
if (browser.process.stderr) browser.process.stderr.pipe(process.stderr);
124124

125125
let success = false;
126126
certCheckServer.waitForSuccess().then(() => {

test/integration-test.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@ describe('Integration test', function () {
5858
stderr = "";
5959

6060
return new Promise((resolve, reject) => {
61-
serverProcess.stdout.on('data', (d) => {
61+
serverProcess.stdout!.on('data', (d) => {
6262
if (d.includes('Server started')) resolve();
6363
stdout = stdout + d.toString();
6464
console.log(d.toString());
6565
});
6666

67-
serverProcess.stderr.on('data', (d) => {
67+
serverProcess.stderr!.on('data', (d) => {
6868
reject();
6969
stderr = stderr + d.toString();
7070
console.warn(d.toString());

0 commit comments

Comments
 (0)