mirror of
https://github.com/zhigang1992/probot.git
synced 2026-06-14 18:08:58 +08:00
* origin/master: (51 commits) remove manual base64 encoding/decoding of private key (#717) chore(test): convert app/default test to TypeScript (#703) chore(test): convert Sentry test to TypeScript (#702) Detect color support (#708) Fix two typos (#709) 7.2.0 httpSSSSSSS (#701) chore(tests): convert serializers test to TypeScript (#695) Update development docs to explain GitHub App Manifests (#700) Probot Support for GitHub App Manifests (#650) Resolve Jest transform option deprecation warning (#694) chore(package): update nock to version 10.0.0 7.1.2 fix(package): require @octokit/webhooks@^5.0.2 (#691) Relax webhooks requirement fix(package): update @octokit/webhooks to version 5.0.1 Update best-practices.md (#682) 7.1.1 add npm ignore for package-locks update octokit/rest and tests to use /app/installations (#681) ...
30 lines
783 B
TypeScript
30 lines
783 B
TypeScript
import { Application, NextFunction, Request, Response } from 'express'
|
|
import request from 'supertest'
|
|
import { logger } from '../src/logger'
|
|
import { createServer } from '../src/server'
|
|
|
|
describe('server', () => {
|
|
let server: Application
|
|
|
|
beforeEach(() => {
|
|
server = createServer({ logger })
|
|
|
|
// Error handler to avoid printing logs
|
|
server.use((err: Error, req: Request, res: Response, next: NextFunction) => {
|
|
res.status(500).send(err.message)
|
|
})
|
|
})
|
|
|
|
describe('GET /ping', () => {
|
|
it('returns a 200 response', () => {
|
|
return request(server).get('/ping').expect(200, 'PONG')
|
|
})
|
|
})
|
|
|
|
describe('with an unknown url', () => {
|
|
it('responds with 404', () => {
|
|
return request(server).get('/lolnotfound').expect(404)
|
|
})
|
|
})
|
|
})
|