Skip to content

Commit

Permalink
fix(http): update superagent to 3.8.3
Browse files Browse the repository at this point in the history
Plus move http tests to karma and browserstack
  • Loading branch information
jvanbruegge authored and staltz committed Aug 17, 2018
1 parent b0360e4 commit fe3c5ce
Show file tree
Hide file tree
Showing 15 changed files with 4,579 additions and 1,419 deletions.
3 changes: 1 addition & 2 deletions http/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
node_modules

# Generated
test/browser/page/tests-bundle.js
lib/
dist/
coverage/
test-support-server.pid

# Misc
Expand Down
20 changes: 0 additions & 20 deletions http/.scripts/saucie-connect.js

This file was deleted.

6 changes: 0 additions & 6 deletions http/.scripts/saucie-disconnect.js

This file was deleted.

29 changes: 29 additions & 0 deletions http/karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
const deepmerge = require('deepmerge');
const common = require('../karma.conf.js');

const urls = [
'/querystring',
'/binary',
'/hello',
'/pet',
'/json',
'/error',
'/delete',
];

module.exports = function(config) {
config.set(
deepmerge(common, {
proxies: urls.reduce(
(acc, curr) => ({
...acc,
[curr]: {target: 'http://localhost:8070' + curr, changeOrigin: true},
}),
{},
),
browserStack: {
name: 'Cycle.js HTTP driver',
},
}),
);
};
61 changes: 31 additions & 30 deletions http/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,44 +9,45 @@
"repository": "https://github.com/cyclejs/cyclejs/tree/master/http",
"dependencies": {
"@cycle/run": "*",
"@types/superagent": "3.5.6",
"superagent": "3.8.2",
"@types/superagent": "3.8.2",
"superagent": "3.8.3",
"xstream": "*"
},
"scripts": {
"test-node": "mocha test/node.ts --require ts-node/register --exit",
"test-browser": "pnpm run start-test-support-server && karma start ; pnpm run stop-test-support-server",
"start-test-support-server": "PORT=8070 ts-node test/support/run-server.ts & echo $! > test-support-server.pid",
"stop-test-support-server": "if ps -p $(cat test-support-server.pid)> /dev/null; then kill -KILL $(cat test-support-server.pid); fi && rm test-support-server.pid",
"test": "pnpm run test-browser",
"test-ci": "CI=true pnpm test"
},
"devDependencies": {
"@cycle/run": "4.1.0",
"@cycle/rxjs-run": "8.0.0",
"@cycle/isolate": "3.2",
"@types/body-parser": "1.16.x",
"@cycle/isolate": "3.4",
"@cycle/run": "4.4.0",
"@cycle/rxjs-run": "^8.0.0",
"@types/body-parser": "1.17.x",
"@types/cookie-parser": "1.4.x",
"@types/express": "4.0.x",
"@types/mocha": "2.2.x",
"@types/node": "7.0.x",
"@types/express": "4.16.x",
"@types/mocha": "5.2.x",
"@types/node": "10.5.x",
"body-parser": "1.18.x",
"cookie-parser": "1.4.3",
"express": "4.16.2",
"rxjs": "5.5.x",
"saucie": "3.3.0",
"deepmerge": "^2.1.1",
"express": "4.16.3",
"isarray": "^2.0.4",
"karma": "2.0.2",
"karma-browserstack-launcher": "^1.3.0",
"karma-chrome-launcher": "^2.2.0",
"karma-cli": "^1.0.1",
"karma-firefox-launcher": "^1.1.0",
"karma-mocha": "^1.3.0",
"karma-typescript": "^3.0.13",
"mocha": "^5.2.0",
"rxjs": "^5.5.11",
"ts-node": "^7.0.0",
"typescript": "~2.8.4",
"xstream": "11.x"
},
"browserify-shim": {
"xstream": "global:xstream"
},
"scripts": {
"test-node": "../node_modules/.bin/mocha test/node.ts --require ts-node/register --exit",
"pretest-browser": "../node_modules/.bin/tsc -p ./test/browser/ && npm run start-test-support-server",
"test-browser": "../node_modules/.bin/testem ci -l Chrome,Firefox",
"posttest-browser": "npm run stop-test-support-server",
"pretest-browser-ci": "npm run pretest-browser",
"test-browser-ci": "../node_modules/.bin/testem ci",
"posttest-browser-ci": "npm run posttest-browser",
"start-test-support-server": "PORT=8070 ../node_modules/.bin/ts-node test/support/run-server.ts & echo $! > test-support-server.pid",
"stop-test-support-server": "if ps -p $(cat test-support-server.pid)> /dev/null; then kill -KILL $(cat test-support-server.pid); fi && rm test-support-server.pid",
"test-ci": "npm run test-node && npm run test-browser-ci",
"test": "npm run test-node && npm run test-browser",
"browserify": "../node_modules/.bin/browserify lib/cjs/index.js --global-transform=browserify-shim --standalone CycleHTTPDriver --exclude xstream --outfile dist/cycle-http-driver.js",
"minify": "node ../.scripts/minify.js dist/cycle-http-driver.js dist/cycle-http-driver.min.js"
},
"homepage": "https://cycle.js.org",
"bugs": "https://github.com/cyclejs/cyclejs/issues",
"contributors": [
Expand Down
16 changes: 16 additions & 0 deletions http/pnpmfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
hooks: {
readPackage,
},
};

function readPackage(pkg, context) {
if (!pkg.dependencies) return pkg;

if (pkg.dependencies.rxjs === '*') {
pkg.dependencies.rxjs = '^5.5.11';
context.log('rxjs@* => rxjs@5 in ' + pkg.name);
}

return pkg;
}

0 comments on commit fe3c5ce

Please sign in to comment.