Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

at this point the PostgreSQL service is accessible from the localhost:5432 tcp address. To create more comples docker-compose file read the official documentation.

test/index.test.js

Code Block
languagejs
const { server } = require("../src/index"); // Adjust the path as necessary
const request = require("supertest");

describe("index.js", function () {
  after(function () {
    server.close(); // Close the server after tests
  });

  it("Test echo root path", function (done) {
    request(server).get("/").expect(200, done);
  });
});

...