test: add x-koa-x-cache header test

This commit is contained in:
DIYgod
2019-01-17 16:31:01 +08:00
parent e12a67310f
commit a32b3313a4

View File

@@ -64,6 +64,11 @@ describe('response', () => {
it(`/test (cache)`, async () => {
const response = await request.get('/test');
expect(response.status).toBe(200);
if (config.cacheType === 'memory') {
expect(response.headers['x-koa-memory-cache']).toBe('true');
} else if (config.cacheType === 'redis') {
expect(response.headers['x-koa-redis-cache']).toBe('true');
}
await checkRSS(response);
});