UNPKG

genuinex-screen-sync-server

Version:
40 lines (31 loc) 911 B
/** * @format */ 'use strict'; const express = require('express'); const router = require('../src/router'); const request = require('supertest'); const createApp = () => { const app = express(); app.use(router); return app; } describe('GET /healthcheck', () => { test('It should 204', async () => { const res = await request(createApp()).get('/healthcheck') expect(res.status).toEqual(204); }); test('It should return an empty body', async () => { const res = await request(createApp()).get('/healthcheck') expect(res.body).toEqual({}); }) }); describe('POST /api/trends', () => { xtest('It should create a trend', async () => { const res = await request(createApp()).post('/api/trends') .set('Content-Type', 'application/json') .set('Accept', 'application/json') .send({ id: 'test', value: 1 }); expect(res.status).toEqual(201); }); })