Skip to content

Commit

Permalink
fixes issues in prposal route
Browse files Browse the repository at this point in the history
  • Loading branch information
ksraj123 committed Jul 29, 2020
1 parent 099f6cf commit f2f9821
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions app/models/Proposal.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ const proposalSchema = new Schema(
type: String,
required: true
},
organization: {
type: String
},
content: {
type: String,
required: true
Expand Down
11 changes: 10 additions & 1 deletion test/proposal.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const app = require('../app')
const app = require('../app').app
const mongoose = require('mongoose')
const jwt = require('jsonwebtoken')
const HttpStatus = require('http-status-codes')
Expand Down Expand Up @@ -195,3 +195,12 @@ test('Should return the proposal by the given Id', async (done) => {

done()
})

afterAll(async () => {
// avoid jest open handle error
await new Promise((resolve) => setTimeout(() => resolve(), 500))
// close server
await server.close()
// Closing the DB connection allows Jest to exit successfully.
await mongoose.connection.close()
})

0 comments on commit f2f9821

Please sign in to comment.