Remove references to lodash

This commit is contained in:
Jonatan Nilsson 2017-12-09 22:55:25 +00:00
parent 157d6f09de
commit aa15a46b61
6 changed files with 15 additions and 8 deletions

0
api/media/routes.js Normal file
View file

View file

@ -4,6 +4,6 @@ import * as test from './test/routes'
const router = new Router() const router = new Router()
router.get('/api/test', test.testStatic) router.get('/', test.testStatic)
export default router export default router

View file

@ -1,6 +1,5 @@
'use strict' 'use strict'
const _ = require('lodash')
const nconf = require('nconf') const nconf = require('nconf')
// Helper method for global usage. // Helper method for global usage.
@ -16,7 +15,14 @@ nconf.inTest = () => nconf.get('NODE_ENV') === 'test'
// Load package.json for name and such // Load package.json for name and such
let pckg = require('./package.json') 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 // Load overrides as first priority

View file

@ -8,9 +8,9 @@
"start": "node index.js", "start": "node index.js",
"test": "env NODE_ENV=test mocha --require babel-register --recursive --reporter dot", "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": "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:test": "npm run docker -- npm install --no-optional && npm run test",
"docker:dev": "npm run docker -- npm install && npm run dev", "docker:dev": "npm run docker -- npm install --no-optional && npm run dev",
"docker:prod": "npm run docker -- npm install && npm run start" "docker:prod": "npm run docker -- npm install --no-optional && npm run start"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@ -33,6 +33,7 @@
"assert-extended": "^1.0.1", "assert-extended": "^1.0.1",
"mocha": "^4.0.1", "mocha": "^4.0.1",
"nodemon": "^1.12.1", "nodemon": "^1.12.1",
"request-json": "^0.6.2" "request-json": "^0.6.2",
"sinon": "^4.1.3"
} }
} }

View file

View file

@ -11,7 +11,7 @@ describe('Server', () => {
it('should run', () => it('should run', () =>
assert.isFulfilled( assert.isFulfilled(
client.getAsync('/api/test') client.getAsync('/')
) )
.then(data => { .then(data => {
assert.ok(data) assert.ok(data)