fix: non-forked packages breaking web build (#225)

pull/196/head
Adam Pash 5 years ago committed by GitHub
parent f3f6e21fd8
commit 0e22947e2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -94,9 +94,9 @@
"watchify": "^3.11.0"
},
"dependencies": {
"browser-request": "^0.3.3",
"browser-request": "postlight/browser-request#feat-add-headers-to-response",
"cheerio": "^0.22.0",
"difflib": "^0.2.4",
"difflib": "postlight/difflib.js",
"ellipsize": "0.1.0",
"iconv-lite": "0.4.24",
"jquery": "^3.3.1",

@ -16,7 +16,15 @@ let urls = [
];
// don't run this on CI b/c we want to avoid network requests
if (process.env.CI) {
if (
process.env.CI ||
(typeof __karma__ !== 'undefined' && __karma__.config.args[0] === '--CI')
) {
if (cheerio.browser) {
require('../dist/mercury.web');
}
// eslint-disable-next-line no-unused-expressions
typeof Mercury === 'undefined' && require('../dist/mercury');
describe('Tests', () => {
it('do not run because this is CI and we do not want network requests', () => {
assert.equal(true, true);

@ -64,5 +64,9 @@ module.exports = function(config) {
// Concurrency level
// how many browser should be started simultaneous
concurrency: Infinity,
client: {
args: config.CI ? ['--CI'] : [],
},
});
};

@ -31,11 +31,10 @@ const stop = () => {
server && server.close();
};
if (!process.env.CI) {
start();
require('child_process').execSync(
'node ./node_modules/karma/bin/karma start ./scripts/karma.conf.js',
{ stdio: [0, 1, 2] }
);
stop();
}
start();
require('child_process').execSync(
'node ./node_modules/karma/bin/karma start ./scripts/karma.conf.js' +
(process.env.CI ? ' --CI' : ''),
{ stdio: [0, 1, 2] }
);
stop();

@ -102,8 +102,12 @@ export default async function fetchResource(url, parsedUrl) {
gzip: true,
// Follow any non-GET redirects
followAllRedirects: true,
// Follow GET redirects
followRedirect: true,
...(typeof window !== 'undefined'
? {}
: {
// Follow GET redirects; this option is for Node only
followRedirect: true,
}),
};
const { response, body } = await get(options);

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save