Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use native Node promisify, to aviod issues with Node 10 #527

Merged
merged 1 commit into from
Jun 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions packages/wct-local/custom_typings/promisify-node.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/wct-local/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
"cleankill": "^2.0.0",
"freeport": "^1.0.4",
"launchpad": "^0.7.0",
"promisify-node": "^0.4.0",
"selenium-standalone": "^6.7.0",
"which": "^1.0.8"
},
Expand Down
6 changes: 3 additions & 3 deletions packages/wct-local/src/browsers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
import * as launchpad from 'launchpad';
import * as wd from 'wd';
import * as promisify from 'promisify-node';
import {promisify} from 'util';

type LaunchpadToWebdriver = (browser: launchpad.Browser, browserOptions?: string[]) => wd.Capabilities;
const LAUNCHPAD_TO_SELENIUM: {[browser: string]: LaunchpadToWebdriver} = {
Expand Down Expand Up @@ -77,8 +77,8 @@ export async function expand(names: string[], browserOptions: {[name: string]: s
* Exported and declared as `let` variables for testabilty in wct.
*/
export let detect = async function detect(browserOptions: {[name: string]: string[]}): Promise<{[browser: string]: wd.Capabilities}> {
const launcher = await promisify(launchpad.local)();
const browsers = await promisify(launcher.browsers)();
const launcher = await promisify<launchpad.Launcher>(launchpad.local)();
const browsers = await promisify<launchpad.Browser[]>(launcher.browsers)();

const results: {[browser: string]: wd.Capabilities} = {};
for (const browser of browsers) {
Expand Down
2 changes: 1 addition & 1 deletion packages/wct-local/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import * as browsers from './browsers';
import * as selenium from './selenium';
import * as wd from 'wd';
import * as wct from 'wct';
import * as promisify from 'promisify-node';
import {promisify} from 'util';

interface PluginOptions {
seleniumArgs?: string[];
Expand Down
6 changes: 3 additions & 3 deletions packages/wct-local/src/selenium.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import * as selenium from 'selenium-standalone';
import * as which from 'which';
import * as child_process from 'child_process';
import * as wct from 'wct';
import * as promisify from 'promisify-node';
import {promisify} from 'util';

const SELENIUM_OVERRIDES: any = require('../package.json')['selenium-overrides'];

Expand Down Expand Up @@ -91,15 +91,15 @@ async function seleniumStart(
try {
const options = SELENIUM_OVERRIDES || {};
options.logger = onOutput;
await promisify(selenium.install)(options);
await promisify<selenium.InstallOpts>(selenium.install)(options);
} catch (error) {
log.forEach((line) => wct.emit('log:info', line));
throw error;
}
}

try {
await promisify(selenium.start)(config);
await promisify<selenium.StartOpts>(selenium.start)(config);
} catch (error) {
log.forEach((line) => wct.emit('log:info', line));
throw error;
Expand Down
16 changes: 0 additions & 16 deletions packages/web-component-tester/custom_typings/promisify-node.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/web-component-tester/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
"multer": "^1.3.0",
"nomnom": "^1.8.1",
"polyserve": "^0.27.11",
"promisify-node": "^0.4.0",
"resolve": "^1.5.0",
"semver": "^5.3.0",
"send": "^0.11.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/web-component-tester/runner/paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import * as fs from 'fs';
import * as glob from 'glob';
import * as _ from 'lodash';
import * as path from 'path';
import * as promisify from 'promisify-node';
import {promisify} from 'util';

/**
* Expands a series of path patterns (globs, files, directories) into a set of
Expand Down