-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from neuroforgede/wip/setup_registry_auth#main
Wip/setup registry auth#main
- Loading branch information
Showing
7 changed files
with
9,381 additions
and
2,206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
}); | ||
|
||
}); |
Oops, something went wrong.