Skip to content

Commit

Permalink
fix: not mockgoose, package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
hboylan committed Nov 8, 2017
1 parent e60f94b commit cd73749
Show file tree
Hide file tree
Showing 8 changed files with 2,451 additions and 1,207 deletions.
14 changes: 8 additions & 6 deletions generators/app/templates/_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,27 @@
"apidoc": "^0.17.6",
"apidoc-markdown": "^0.2.0",
"babel-eslint": "^8.0.1",
"babel-jest": "^20.0.3",
"babel-jest": "^21.2.0",
"cross-env": "^5.0.5",
"dotenv-safe": "^4.0.3",
"eslint": "^4.4.1",
"eslint-config-standard": "^10.2.1",
"eslint-plugin-promise": "^3.0.0",
"eslint-plugin-import": "^2.8.0",
"eslint-plugin-node": "^5.2.1",
"eslint-plugin-promise": "^3.6.0",
"eslint-plugin-standard": "^3.0.1",
"jest-cli": "^20.0.4",
"mockgoose": "^7.3.3",
"jest-cli": "^21.2.1",
"mockgoose": "^6.0.8",
"nock": "^9.0.2",
"nodemon": "^1.10.2",
"opn-cli": "^3.1.0",
"sinon": "^4.0.1",
"sinon": "^4.1.2",
"supertest": "^3.0.0"
},
"dependencies": {
"babel-core": "^6.26.0",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-env": "^1.6.1",
"babel-preset-stage-1": "^6.24.1",
"babel-runtime": "^6.26.0",
<%_ if (generateAuthApi && passwordSignup) { _%>
Expand Down
2 changes: 1 addition & 1 deletion generators/app/templates/api/auth/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ test('POST /auth 401 (master) - missing auth', async () => {
<%_ authServices.forEach(function(service) { _%>

test('POST /auth/<%= service %> 201', async () => {
stub(<%= service %>, 'getUser', () => Promise.resolve({
stub(<%= service %>, 'getUser').callsFake(() => Promise.resolve({
service: '<%= service %>',
id: '123',
name: 'user',
Expand Down
2 changes: 1 addition & 1 deletion generators/app/templates/babelrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"presets": [
"es2015",
"env",
"stage-1"
],
"plugins": [
Expand Down
2 changes: 1 addition & 1 deletion generators/app/templates/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import api from './api'
const app = express(apiRoot, api)
const server = http.createServer(app)

mongoose.connect(mongo.uri, { useMongoClient: true })
mongoose.connect(mongo.uri, mongo.options)
mongoose.Promise = Promise

setImmediate(() => {
Expand Down
17 changes: 7 additions & 10 deletions generators/app/templates/src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,30 +31,24 @@ const config = {
<%_ if (typeof sendgridKey !== 'undefined' && sendgridKey) { _%>
sendgridKey: requireProcessEnv('SENDGRID_KEY'),
<%_ } _%>
masterKey: requireProcessEnv('MASTER_KEY'),
<%_ if (typeof generateAuthApi !== 'undefined' && generateAuthApi) { _%>
jwtSecret: requireProcessEnv('JWT_SECRET'),
<%_ } _%>
mongo: {
options: {
db: {
safe: true
}
}
}
masterKey: requireProcessEnv('MASTER_KEY')
},
test: {
mongo: {
uri: 'mongodb://localhost/<%= slug %>-test',
options: {
debug: false
useMongoClient: true
}
}
},
development: {
mongo: {
uri: 'mongodb://localhost/<%= slug %>-dev',
options: {
useMongoClient: true,
debug: true
}
}
Expand All @@ -63,7 +57,10 @@ const config = {
ip: process.env.IP || undefined,
port: process.env.PORT || 8080,
mongo: {
uri: process.env.MONGODB_URI || 'mongodb://localhost/<%= slug %>'
uri: process.env.MONGODB_URI || 'mongodb://localhost/<%= slug %>',
options: {
useMongoClient: true
}
}
}
}
Expand Down
8 changes: 3 additions & 5 deletions generators/app/templates/test/setup.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { EventEmitter } from 'events'
import { Mockgoose } from 'mockgoose'
import mockgoose from 'mockgoose'
import mongoose from '../<%= srcDir %>/services/mongoose'
import { mongo } from '../<%= srcDir %>/config'

Expand All @@ -22,11 +22,9 @@ global.TypeError = TypeError
global.parseInt = parseInt
global.parseFloat = parseFloat

const mockgoose = new Mockgoose(mongoose)

beforeAll(async () => {
await mockgoose.prepareStorage()
mongoose.connect(mongo.uri)
await mockgoose(mongoose)
mongoose.connect(mongo.uri, mongo.options)
})

afterAll(() => {
Expand Down
62 changes: 32 additions & 30 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"yeoman"
],
"dependencies": {
"bluebird": "^3.4.6",
"bluebird": "^3.5.1",
"chalk": "^1.0.0",
"lodash": "^4.15.0",
"pluralize": "^3.0.0",
Expand All @@ -43,25 +43,27 @@
"yosay": "^1.0.0"
},
"devDependencies": {
"babel-core": "^6.17.0",
"babel-eslint": "^7.0.0",
"babel-jest": "^18.0.0",
"babel-plugin-transform-runtime": "^6.15.0",
"babel-preset-es2015": "^6.9.0",
"babel-preset-stage-1": "^6.16.0",
"babel-runtime": "^6.11.6",
"bcrypt": "^1.0.2",
"body-parser": "^1.15.1",
"bodymen": "^1.0.1",
"compression": "^1.6.2",
"cors": "^2.7.1",
"babel-core": "^6.26.0",
"babel-eslint": "^8.0.1",
"babel-jest": "^21.2.0",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-env": "^1.6.1",
"babel-preset-stage-1": "^6.24.1",
"babel-runtime": "^6.26.0",
"bcrypt": "^1.0.3",
"body-parser": "^1.18.2",
"bodymen": "^1.0.3",
"compression": "^1.7.1",
"cors": "^2.8.4",
"dotenv-safe": "^4.0.3",
"eslint": "^3.1.1",
"eslint-config-standard": "^6.0.0",
"eslint-config-xo-space": "^0.14.0",
"eslint-plugin-promise": "^3.0.0",
"eslint-plugin-standard": "^2.0.0",
"express": "^4.13.4",
"eslint": "^4.4.1",
"eslint-config-standard": "^10.2.1",
"eslint-config-xo-space": "^0.17.0",
"eslint-plugin-import": "^2.8.0",
"eslint-plugin-node": "^5.2.1",
"eslint-plugin-promise": "^3.6.0",
"eslint-plugin-standard": "^3.0.1",
"express": "^4.16.2",
"express-force-ssl": "^0.3.2",
"fs-extra": "^0.30.0",
"gulp": "^3.9.0",
Expand All @@ -73,24 +75,24 @@
"gulp-mocha": "^2.0.0",
"gulp-nsp": "^2.1.0",
"gulp-plumber": "^1.0.0",
"jest-cli": "^18.1.0",
"jsonwebtoken": "^7.1.9",
"mockgoose": "^7.3.3",
"jest-cli": "^21.2.1",
"jsonwebtoken": "^8.1.0",
"mockgoose": "^6.0.8",
"mongoose": "^4.13.0",
"mongoose-create-unique": "^0.4.1",
"mongoose-keywords": "^0.3.1",
"mongoose-create-unique": "^0.4.4",
"mongoose-keywords": "^0.3.2",
"morgan": "^1.7.0",
"nock": "^9.0.2",
"nodemon": "^1.10.2",
"passport": "^0.3.2",
"passport": "^0.4.0",
"passport-http": "^0.3.0",
"passport-http-bearer": "^1.0.1",
"passport-jwt": "^2.1.0",
"querymen": "^2.0.0",
"request": "^2.74.0",
"request-promise": "^4.1.1",
"passport-jwt": "^3.0.0",
"querymen": "^2.1.3",
"request": "^2.83.0",
"request-promise": "^4.2.2",
"sendgrid": "^4.0.2",
"sinon": "^1.17.5",
"sinon": "^4.1.2",
"supertest": "^3.0.0",
"yeoman-assert": "^2.0.0",
"yeoman-test": "^1.0.0"
Expand Down
Loading

0 comments on commit cd73749

Please sign in to comment.