From aa15a46b61a52f4e67544947164bb85d4bf6bf98 Mon Sep 17 00:00:00 2001 From: Jonatan Nilsson Date: Sat, 9 Dec 2017 22:55:25 +0000 Subject: [PATCH] Remove references to lodash --- api/media/routes.js | 0 api/router.js | 2 +- config.js | 10 ++++++++-- package.json | 9 +++++---- test/media/routes.test.js | 0 test/server.test.js | 2 +- 6 files changed, 15 insertions(+), 8 deletions(-) create mode 100644 api/media/routes.js create mode 100644 test/media/routes.test.js diff --git a/api/media/routes.js b/api/media/routes.js new file mode 100644 index 0000000..e69de29 diff --git a/api/router.js b/api/router.js index 9e96ca2..1e7a12a 100644 --- a/api/router.js +++ b/api/router.js @@ -4,6 +4,6 @@ import * as test from './test/routes' const router = new Router() -router.get('/api/test', test.testStatic) +router.get('/', test.testStatic) export default router diff --git a/config.js b/config.js index ed1768c..8e4bcbe 100644 --- a/config.js +++ b/config.js @@ -1,6 +1,5 @@ 'use strict' -const _ = require('lodash') const nconf = require('nconf') // Helper method for global usage. @@ -16,7 +15,14 @@ nconf.inTest = () => nconf.get('NODE_ENV') === 'test' // Load package.json for name and such let pckg = require('./package.json') -pckg = _.pick(pckg, ['name', 'version', 'description', 'author', 'license', 'homepage']) +pckg = { + name: pckg.name, + version: pckg.version, + description: pckg.description, + author: pckg.author, + license: pckg.license, + homepage: pckg.homepage, +} // Load overrides as first priority diff --git a/package.json b/package.json index f8a0e63..65e3c06 100644 --- a/package.json +++ b/package.json @@ -8,9 +8,9 @@ "start": "node index.js", "test": "env NODE_ENV=test mocha --require babel-register --recursive --reporter dot", "docker": "docker run -it --rm --name my-running-script -v \"$PWD\":/usr/src/app -w /usr/src/app node:slim", - "docker:test": "npm run docker -- npm install && npm run test", - "docker:dev": "npm run docker -- npm install && npm run dev", - "docker:prod": "npm run docker -- npm install && npm run start" + "docker:test": "npm run docker -- npm install --no-optional && npm run test", + "docker:dev": "npm run docker -- npm install --no-optional && npm run dev", + "docker:prod": "npm run docker -- npm install --no-optional && npm run start" }, "repository": { "type": "git", @@ -33,6 +33,7 @@ "assert-extended": "^1.0.1", "mocha": "^4.0.1", "nodemon": "^1.12.1", - "request-json": "^0.6.2" + "request-json": "^0.6.2", + "sinon": "^4.1.3" } } diff --git a/test/media/routes.test.js b/test/media/routes.test.js new file mode 100644 index 0000000..e69de29 diff --git a/test/server.test.js b/test/server.test.js index 3b5605d..0430e88 100644 --- a/test/server.test.js +++ b/test/server.test.js @@ -11,7 +11,7 @@ describe('Server', () => { it('should run', () => assert.isFulfilled( - client.getAsync('/api/test') + client.getAsync('/') ) .then(data => { assert.ok(data)