gateway.test.js 423 B

1234567891011121314151617
  1. const app = require("../server");
  2. const supertest = require("supertest");
  3. const request = supertest(app.server);
  4. beforeAll(async () => {
  5. await app.ready();
  6. });
  7. it("send test message to endpoint", async() => {
  8. const response = await request.post('/').send({message: "test"});
  9. expect(response.status).toBe(200);
  10. expect(response.body.status).toBe("ok");
  11. });
  12. afterAll(async () => {
  13. await app.close();
  14. });