Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions test/user-profile-test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import chai from 'chai'
import chaiHttp from 'chai-http'
import { describe, it } from 'mocha'

var should = chai.should();

import app from '../src/app'


chai.use(chaiHttp)
const { expect } = chai




describe('profile update',()=> {

it('should update the profile pge and return a message',(hi)=>{
let update={
firstname:'harshil',
lastname:'shah',
password:'123',
teams:['2','3']
}
chai.request('http://localhost:3000')
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not the correct way. check sample code repo

.post('/user/profile')
.send(update)
.end((err,res)=>{
res.should.have.status(200);
res.body.should.be.json;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check responses individually, like expect the response to contain new data

hi()
}).catch((e)=>hi(e))
})

})


/*

describe('Test Suite', () => {
it('Should Just Pass', (done) => {
chai
.request(app)
.get('/')
.then((res) => {
expect(res.status).to.be.equal(200)
done()
})
.catch((e) => done(e))
})
})
*/