Skip to content

Commit

Permalink
Ditched goinstant-assert in favor o chai
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoScabbiolo committed Jul 9, 2018
1 parent 9038080 commit 4937ff4
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 16 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
"tunnel": "^0.0.5"
},
"devDependencies": {
"chai": "^4.1.2",
"eslint": "^5.1.0",
"eslint-config-prettier": "^2.9.0",
"eslint-config-xo": "^0.23.0",
"eslint-plugin-prettier": "^2.6.2",
"goinstant-assert": "^1.1.1",
"mocha": "^5.2.0",
"prettier": "^1.13.7",
"request": "^2.83.0",
Expand Down
8 changes: 4 additions & 4 deletions test/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
var assert = require('goinstant-assert');
var assert = require('chai').assert;
var sinon = require('sinon');
var assign = require('lodash/assign');
var pick = require('lodash/pick');
Expand Down Expand Up @@ -80,23 +80,23 @@ describe('global-proxy', function() {
describe('invalid configs', function() {
it('requires a host', function() {
var conf = { host: null, port: 1234 };
assert.exception(function() {
assert.throws(function() {
globalTunnel.initialize(conf);
}, 'upstream proxy host is required');
globalTunnel.end();
});

it('requires a port', function() {
var conf = { host: '10.2.3.4', port: 0 };
assert.exception(function() {
assert.throws(function() {
globalTunnel.initialize(conf);
}, 'upstream proxy port is required');
globalTunnel.end();
});

it('clamps tunnel types', function() {
var conf = { host: '10.2.3.4', port: 1234, connect: 'INVALID' };
assert.exception(function() {
assert.throws(function() {
globalTunnel.initialize(conf);
}, 'valid connect options are "neither", "https", or "both"');
globalTunnel.end();
Expand Down
45 changes: 34 additions & 11 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ [email protected], assert-plus@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525"

assertion-error@^1.0.1:
version "1.1.0"
resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b"

asynckit@^0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
Expand Down Expand Up @@ -149,6 +153,17 @@ caseless@~0.12.0:
version "0.12.0"
resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc"

chai@^4.1.2:
version "4.1.2"
resolved "https://registry.yarnpkg.com/chai/-/chai-4.1.2.tgz#0f64584ba642f0f2ace2806279f4f06ca23ad73c"
dependencies:
assertion-error "^1.0.1"
check-error "^1.0.1"
deep-eql "^3.0.0"
get-func-name "^2.0.0"
pathval "^1.0.0"
type-detect "^4.0.0"

chalk@^1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98"
Expand All @@ -171,6 +186,10 @@ chardet@^0.4.0:
version "0.4.2"
resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2"

check-error@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82"

circular-json@^0.3.1:
version "0.3.3"
resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.3.tgz#815c99ea84f6809529d2f45791bdf82711352d66"
Expand Down Expand Up @@ -246,6 +265,12 @@ [email protected], debug@^3.1.0:
dependencies:
ms "2.0.0"

deep-eql@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-3.0.1.tgz#dfc9404400ad1c8fe023e7da1df1c147c4b444df"
dependencies:
type-detect "^4.0.0"

deep-is@~0.1.3:
version "0.1.3"
resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34"
Expand Down Expand Up @@ -508,6 +533,10 @@ functional-red-black-tree@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327"

get-func-name@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41"

get-stdin@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-5.0.1.tgz#122e161591e21ff4c52530305693f20e6393a398"
Expand Down Expand Up @@ -544,12 +573,6 @@ globby@^5.0.0:
pify "^2.0.0"
pinkie-promise "^2.0.0"

goinstant-assert@^1.1.1:
version "1.1.2"
resolved "https://registry.yarnpkg.com/goinstant-assert/-/goinstant-assert-1.1.2.tgz#a6bfcc2cb74afb97833cce1de73c5934598ef7a7"
dependencies:
lodash "1.3.1"

graceful-fs@^4.1.2:
version "4.1.11"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658"
Expand Down Expand Up @@ -773,10 +796,6 @@ lodash.get@^4.4.2:
version "4.4.2"
resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99"

[email protected]:
version "1.3.1"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-1.3.1.tgz#a4663b53686b895ff074e2ba504dfb76a8e2b770"

lodash@^4.17.10, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.3.0:
version "4.17.10"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7"
Expand Down Expand Up @@ -921,6 +940,10 @@ path-to-regexp@^1.7.0:
dependencies:
isarray "0.0.1"

pathval@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.0.tgz#b942e6d4bde653005ef6b71361def8727d0645e0"

performance-now@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
Expand Down Expand Up @@ -1216,7 +1239,7 @@ type-check@~0.3.2:
dependencies:
prelude-ls "~1.1.2"

type-detect@^4.0.8:
type-detect@^4.0.0, type-detect@^4.0.8:
version "4.0.8"
resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c"

Expand Down

0 comments on commit 4937ff4

Please sign in to comment.