From 4937ff4622fd7a2e199a4ef4025efae1bc4bab87 Mon Sep 17 00:00:00 2001 From: Marco Scabbiolo Date: Mon, 9 Jul 2018 20:07:55 -0300 Subject: [PATCH] Ditched goinstant-assert in favor o chai --- package.json | 2 +- test/index.js | 8 ++++---- yarn.lock | 45 ++++++++++++++++++++++++++++++++++----------- 3 files changed, 39 insertions(+), 16 deletions(-) diff --git a/package.json b/package.json index 87e188a..fe7f1c5 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/test/index.js b/test/index.js index b3e28b0..52211e8 100644 --- a/test/index.js +++ b/test/index.js @@ -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'); @@ -80,7 +80,7 @@ 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(); @@ -88,7 +88,7 @@ describe('global-proxy', function() { 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(); @@ -96,7 +96,7 @@ describe('global-proxy', function() { 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(); diff --git a/yarn.lock b/yarn.lock index a33a3ff..9ac6667 100644 --- a/yarn.lock +++ b/yarn.lock @@ -94,6 +94,10 @@ assert-plus@1.0.0, 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" @@ -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" @@ -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" @@ -246,6 +265,12 @@ debug@3.1.0, 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" @@ -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" @@ -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" @@ -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" -lodash@1.3.1: - 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" @@ -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" @@ -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"