Skip to content
Permalink
Browse files

Breaking: Replace `chrome` connector with `puppeteer`

Fix #2255
  • Loading branch information...
molant committed Apr 24, 2019
1 parent bbce68a commit 086a4a7aff82cd72d6d18d5c004657e908127faf
@@ -337,8 +337,8 @@ export default class PuppeteerConnector implements IConnector {
const options = {
headers,
// we sync the ignore SSL error options with `request`. This is neeeded for local https tests
rejectUnauthorized: this._options.ignoreHTTPSErrors,
strictSSL: this._options.ignoreHTTPSErrors
rejectUnauthorized: !this._options.ignoreHTTPSErrors,
strictSSL: !this._options.ignoreHTTPSErrors
};

const request = new Requester(options);
@@ -1,12 +1,13 @@
{
"dependencies": {
"@hint/connector-chrome": "^4.0.1",
"@hint/connector-jsdom": "^4.0.1",
"@hint/connector-local": "^3.0.1",
"@hint/connector-puppeteer": "^1.0.0",
"@hint/utils": "^2.0.0",
"@hint/utils-create-server": "^3.1.1",
"ava": "^1.4.1",
"hint": "^5.0.1"
"hint": "^5.0.1",
"is-ci": "^2.0.0"
},
"description": "hint tests helpers",
"devDependencies": {
@@ -1,26 +1,45 @@
import * as isCI from 'is-ci';

/*
* This interface needs to be imported in order
* to generate the definition of this file.
*/
import { IConnectorConstructor } from 'hint';

import ChromeConnector from '@hint/connector-chrome';
import PuppeteerConnector from '@hint/connector-puppeteer';
import JSDOMConnector from '@hint/connector-jsdom';

/** The IDs of the available connectors to test. */
export const ids = [
'chrome',
const ids = [
'jsdom'
];

/** The Constructors of the available connectors to test. */
export const connectors: { ctor: IConnectorConstructor; name: string }[] = [
{
ctor: ChromeConnector,
name: 'chrome'
},
const connectors: { ctor: IConnectorConstructor; name: string }[] = [
{
ctor: JSDOMConnector,
name: 'jsdom'
}
];

/**
* Azure Pipelines has an old version of Chrome that does not
* work with puppeteer correctly. This is needed to ignore
* the connector until they update.
*/
if (!(isCI && process.platform === 'win32')) {
/**
* Need to `unshift` instead of `push` because otherwise some
* tests with `jsdom` could time out (i.e.: `no-disallowed-headers`)
*/
ids.unshift('puppeteer');
connectors.unshift({
ctor: PuppeteerConnector,
name: 'puppeteer'
});
}

export {
connectors,
ids
};
@@ -109,8 +109,12 @@ const createConfig = (id: string, connector: string, opts?: any): Configuration
parsers: determineParsers(opts && opts.parsers)
};

// Allow us to use our self-signed cert for testing.
config.connector.options = { ignoreHTTPSErrors: true };
// Defaults needed to run the tests
config.connector.options = {
detached: true, // This only applies to `puppeteer`
ignoreHTTPSErrors: true,
waitUntil: 'networkidle0' // This only applies to `puppeteer`
};

return Configuration.fromConfig(config);
};
@@ -14,9 +14,9 @@
"tests/**/*.ts"
],
"references": [
{ "path": "../connector-chrome" },
{ "path": "../connector-jsdom" },
{ "path": "../connector-local" },
{ "path": "../connector-puppeteer" },
{ "path": "../hint" },
{ "path": "../utils" },
{ "path": "../utils-create-server" }
@@ -737,7 +737,12 @@
resolved "https://registry.yarnpkg.com/@types/lockfile/-/lockfile-1.0.1.tgz#434a3455e89843312f01976e010c60f1bcbd56f7"
integrity sha512-65WZedEm4AnOsBDdsapJJG42MhROu3n4aSSiu87JXF/pSdlubxZxp3S1yz3kTfkJ2KBPud4CpjoHVAptOm9Zmw==

"@types/lodash@^4.14.123", "@types/lodash@^4.14.129":
"@types/lodash@^4.14.123":
version "4.14.125"
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.125.tgz#b5fa71f3080a2136ba2702c390ffe528ec1e3980"
integrity sha512-s29jU/MIOSddXeji0TSZPJjf0agnfJYpWeKlr79BbtXlfuYamGVyCNQA2IRi5/plaQiNSxMmNGdvFbdtMMJ3nw==

"@types/lodash@^4.14.129":
version "4.14.129"
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.129.tgz#9aaca391db126802482655c48dd79a814488202f"
integrity sha512-oYaV0eSlnOacOr7i4X1FFdH8ttSlb57gu3I9MuStIv2CYkISEY84dNHYsC3bF6sNH7qYcu1BtVrCtQ8Q4KPTfQ==

0 comments on commit 086a4a7

Please sign in to comment.
You can’t perform that action at this time.