Skip to content
Snippets Groups Projects
Commit 62dee16c authored by Sigmund, Dominik's avatar Sigmund, Dominik Committed by Sigmund, Dominik
Browse files

Fix tests

parent 46a6c826
No related branches found
No related tags found
No related merge requests found
Source diff could not be displayed: it is too large. Options to address this: view the blob.
......@@ -109,7 +109,6 @@ describe('Unit Tests', () => {
done()
})
})
done()
})
})
describe('Defined Routes', () => {
......@@ -201,22 +200,17 @@ describe('Integration Tests', () => {
})
})
})
it('should allow given Methods', (done) => {
it('should allow given Methods', async () => {
startUpServer({
allowedMethods: ['HEAD']
allowedMethods: ['POST']
})
superagent
.head('http://127.0.0.1:7777')
.then(res => {
const res = await superagent.post('http://127.0.0.1:7777').send({});
expect(res.status).toBe(200)
superagent
.get('http://127.0.0.1:7777')
.then(res2 => {})
.catch((error) => {
try {
const res2 = await superagent.get('http://127.0.0.1:7777');
} catch (error) {
expect(error.status).toBe(405)
done()
})
})
}
})
})
......@@ -365,6 +359,9 @@ function startUpServer(options) {
app.get('/', function (req, res) {
res.send('Hello World!')
})
app.post('/', function (req, res) {
res.send('Some post')
})
app.get('/test', function (req, res) {
res.send('Hello Test!')
})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment