Skip to content

Commit

Permalink
Merge pull request #3 from neuroforgede/wip/setup_registry_auth#main
Browse files Browse the repository at this point in the history
Wip/setup registry auth#main
  • Loading branch information
s4ke authored May 26, 2024
2 parents 2b616de + f937b1c commit f5cd681
Show file tree
Hide file tree
Showing 7 changed files with 9,381 additions and 2,206 deletions.
41 changes: 41 additions & 0 deletions swarmgate/app.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { before } from "lodash";
import express from "express";
import bodyParser from 'body-parser';
import http from "http";
import Docker from "dockerode";
import {setupRoutes} from "./routes";

function startApp(port: number) {
var app = express();
app.use(bodyParser.json());
const router = setupRoutes("someTenant");
app.use('/', router);

console.log("starting server on port " + port);
return http.createServer(app).listen(port);
}

describe('proxy', () => {
let server: http.Server;
let docker: Docker;

beforeEach(() => {
server = startApp(9999);
docker = new Docker({
host: 'localhost',
port: 9999,
protocol: 'http'
});
});

afterEach(() => {
server.close();
});

it('should return 200', async () => {
const dockerVersion = await docker.version();
expect(dockerVersion).toBeDefined();
expect(dockerVersion.Version).toBeDefined();
});

});
Loading

0 comments on commit f5cd681

Please sign in to comment.