update dependencies

master
Buddy Sandidge 5 years ago
parent 47c65ad9c7
commit 19a206bf1e

@ -14,6 +14,5 @@
"node": true "node": true
}, },
"extends": "eslint:recommended", "extends": "eslint:recommended",
"ecmaFeatures": {},
"plugins": [] "plugins": []
} }

@ -8,8 +8,7 @@ var isRegExp = utils.isRegExp
var isString = utils.isString var isString = utils.isString
var noop = utils.noop var noop = utils.noop
function RouteNode (options) { function RouteNode () {
options = options || {}
this._children = Object.create(null) this._children = Object.create(null)
this._funcs = Object.create(null) this._funcs = Object.create(null)
this._regExs = Object.create(null) this._regExs = Object.create(null)

@ -10,8 +10,7 @@ var isFunction = utils.isFunction
var isString = utils.isString var isString = utils.isString
var noop = utils.noop var noop = utils.noop
function Router(options) { function Router() {
options = options || {}
this.routes = new RouteNode() this.routes = new RouteNode()
} }

@ -27,8 +27,8 @@
}, },
"homepage": "https://github.com/xbudex/routing-buddy#readme", "homepage": "https://github.com/xbudex/routing-buddy#readme",
"devDependencies": { "devDependencies": {
"eslint": "^1.10.3", "eslint": "^6.8.0",
"expect": "^1.14.0", "expect": "^25.5.0",
"mocha": "^2.4.5" "mocha": "^7.1.2"
} }
} }

@ -3,7 +3,7 @@ var RouteNode = require('../lib/route-node')
module.exports = describe('RouteNode', function () { module.exports = describe('RouteNode', function () {
it('→ exists', function () { it('→ exists', function () {
expect(new RouteNode()).toExist() expect(new RouteNode()).not.toBeUndefined()
}) })
describe('→ add nodes', function () { describe('→ add nodes', function () {
@ -38,11 +38,11 @@ module.exports = describe('RouteNode', function () {
it('→ get error callback for not found', function (done) { it('→ get error callback for not found', function (done) {
node.get(['fake', 'route'], [], function (err, func, cbContext, args) { node.get(['fake', 'route'], [], function (err, func, cbContext, args) {
expect(err).toBeA(Error) expect(err).toBeInstanceOf(Error)
expect(err.message).toMatch(/not found/) expect(err.message).toMatch(/not found/)
expect(func).toNotExist() expect(func).toBeUndefined()
expect(cbContext).toNotExist() expect(cbContext).toBeUndefined()
expect(args).toNotExist() expect(args).toBeUndefined()
done() done()
}) })
}) })

@ -4,7 +4,7 @@ var NotFoundError = require('../lib/error').NotFound
describe('Router', function () { describe('Router', function () {
it('→ exists', function () { it('→ exists', function () {
expect(Router).toExist() expect(Router).not.toBeUndefined()
}) })
it('→ add root node', function (done) { it('→ add root node', function (done) {
@ -31,7 +31,7 @@ describe('Router', function () {
var router = new Router() var router = new Router()
router.add(['/user', /^(\d+)$/], function (number) { return number }) router.add(['/user', /^(\d+)$/], function (number) { return number })
router.route('/user/', function (err) { router.route('/user/', function (err) {
expect(err).toBeA(NotFoundError) expect(err).toBeInstanceOf(NotFoundError)
done() done()
}) })
}) })
@ -39,9 +39,9 @@ describe('Router', function () {
it('→ get error in callback for missing handler', function (done) { it('→ get error in callback for missing handler', function (done) {
var router = new Router() var router = new Router()
router.route('/some/fake/path', function (err, handlerResult) { router.route('/some/fake/path', function (err, handlerResult) {
expect(err).toBeA(Error) expect(err).toBeInstanceOf(Error)
expect(err.message).toMatch(/not found/) expect(err.message).toMatch(/not found/)
expect(handlerResult).toNotExist() expect(handlerResult).toBeUndefined()
done() done()
}) })
}) })
@ -62,7 +62,7 @@ describe('Router', function () {
var router = new Router() var router = new Router()
router.add(['/by/id', /\d+/], function () {}) router.add(['/by/id', /\d+/], function () {})
router.route('/by/id/not-an-id', function (err) { router.route('/by/id/not-an-id', function (err) {
expect(err).toBeA(NotFoundError) expect(err).toBeInstanceOf(NotFoundError)
done() done()
}) })
}) })
@ -85,8 +85,8 @@ describe('Router', function () {
var router = new Router() var router = new Router()
router.add(['by', 'order', /(\d+)/], function (one, two, three) { router.add(['by', 'order', /(\d+)/], function (one, two, three) {
expect(one).toBe('1') expect(one).toBe('1')
expect(two).toNotExist() expect(two).toBeUndefined()
expect(three).toNotExist() expect(three).toBeUndefined()
}) })
router.route('/by/order/1-2-3', function (err) { router.route('/by/order/1-2-3', function (err) {
@ -131,7 +131,7 @@ describe('Router', function () {
var router = new Router() var router = new Router()
router.add(['/by/order', toInt], function () {}) router.add(['/by/order', toInt], function () {})
router.route('/by/order/not-found', function (err) { router.route('/by/order/not-found', function (err) {
expect(err).toBeA(NotFoundError) expect(err).toBeInstanceOf(NotFoundError)
done() done()
}) })
}) })

@ -16,12 +16,12 @@ SomeClass.prototype.bar = 'asdf'
describe('utils', function () { describe('utils', function () {
it('→ exists', function () { it('→ exists', function () {
expect(utils).toExist() expect(utils).not.toBeUndefined()
}) })
describe('→ noop', function () { describe('→ noop', function () {
it('→ is a function', function () { it('→ is a function', function () {
expect(noop).toBeA(Function) expect(noop).toBeInstanceOf(Function)
}) })
}) })

Loading…
Cancel
Save