Skip to content

Commit

Permalink
format with prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
Carmine DiMascio committed Aug 19, 2019
1 parent b699e5d commit f738d7f
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions test/request.bodies.ref.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ describe(packageJson.name, () => {

before(async () => {
// Set up the express app
const apiSpec = path.join(
'test',
'resources',
'request.bodies.ref.yaml',
);
const apiSpec = path.join('test', 'resources', 'request.bodies.ref.yaml');
app = await createApp({ apiSpec }, 3005);
basePath = app.basePath;

Expand All @@ -25,7 +21,7 @@ describe(packageJson.name, () => {
`${basePath}`,
express
.Router()
.post(`/request_bodies_ref`, (req, res) => res.json(req.body))
.post(`/request_bodies_ref`, (req, res) => res.json(req.body)),
);
});

Expand All @@ -39,17 +35,19 @@ describe(packageJson.name, () => {
.send({})
.expect(400)
.then(r => {
expect(r.body.errors).to.be.an('array')
expect(r.body.errors).to.be.an('array');
expect(r.body.errors).to.have.length(1);
const message = r.body.errors[0].message;
expect(message).to.equal('should have required property \'testProperty\'');
expect(message).to.equal(
"should have required property 'testProperty'",
);
}));

it('should return 200 if testProperty body property is provided', async () =>
request(app)
.post(`${basePath}/request_bodies_ref`)
.send({
testProperty: 'abc'
testProperty: 'abc',
})
.expect(200));
});

0 comments on commit f738d7f

Please sign in to comment.