Skip to content

Commit

Permalink
Merge pull request #120 from KOSASIH/deepsource-transform-b71e930f
Browse files Browse the repository at this point in the history
style: format code with Autopep8, Black, ClangFormat, dotnet-format, Go fmt, Gofumpt, Google Java Format, isort, Ktlint, PHP CS Fixer, Prettier, RuboCop, Ruff Formatter, Rustfmt, Scalafmt, StandardJS, StandardRB, swift-format and Yapf
  • Loading branch information
KOSASIH authored May 10, 2024
2 parents 41a1176 + bee87a2 commit a08c088
Showing 1 changed file with 31 additions and 31 deletions.
62 changes: 31 additions & 31 deletions test/user.test.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// test/user.test.js

const chai = require('chai');
const chaiHttp = require('chai-http');
const app = require('../app');
const User = require('../models/user');
const chai = require('chai')
const chaiHttp = require('chai-http')
const app = require('../app')
const User = require('../models/user')

const expect = chai.expect;
chai.use(chaiHttp);
const expect = chai.expect
chai.use(chaiHttp)

describe('User API', () => {
describe('POST /register', () => {
Expand All @@ -16,17 +16,17 @@ describe('User API', () => {
lastName: 'Doe',
email: '[email protected]',
password: 'password123'
});

expect(res).to.have.status(201);
expect(res.body).to.be.an('object');
expect(res.body.user).to.have.property('_id');
expect(res.body.user).to.have.property('firstName', 'John');
expect(res.body.user).to.have.property('lastName', 'Doe');
expect(res.body.user).to.have.property('email', '[email protected]');
expect(res.body.user).to.have.property('password', 'password123');
});
});
})

expect(res).to.have.status(201)
expect(res.body).to.be.an('object')
expect(res.body.user).to.have.property('_id')
expect(res.body.user).to.have.property('firstName', 'John')
expect(res.body.user).to.have.property('lastName', 'Doe')
expect(res.body.user).to.have.property('email', '[email protected]')
expect(res.body.user).to.have.property('password', 'password123')
})
})

describe('POST /login', () => {
it('should login a user', async () => {
Expand All @@ -35,22 +35,22 @@ describe('User API', () => {
lastName: 'Doe',
email: '[email protected]',
password: 'password123'
});
})

await user.save();
await user.save()

const res = await chai.request(app).post('/login').send({
email: '[email protected]',
password: 'password123'
});

expect(res).to.have.status(200);
expect(res.body).to.be.an('object');
expect(res.body.user).to.have.property('_id');
expect(res.body.user).to.have.property('firstName', 'Jane');
expect(res.body.user).to.have.property('lastName', 'Doe');
expect(res.body.user).to.have.property('email', '[email protected]');
expect(res.body.user).to.have.property('password', 'password123');
});
});
});
})

expect(res).to.have.status(200)
expect(res.body).to.be.an('object')
expect(res.body.user).to.have.property('_id')
expect(res.body.user).to.have.property('firstName', 'Jane')
expect(res.body.user).to.have.property('lastName', 'Doe')
expect(res.body.user).to.have.property('email', '[email protected]')
expect(res.body.user).to.have.property('password', 'password123')
})
})
})

0 comments on commit a08c088

Please sign in to comment.