Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import http from 'http'
import fetch from 'node-fetch'
import { getHostAddress, getServiceAddress } from 'dockest/dist/test-helper'
const TARGET_HOST = getServiceAddress('aws_codebuild_website', 9000)
// hostname is either our docker container hostname or if not run inside a docker container the docker host
const HOSTNAME = getHostAddress()
const PORT = 8080
let server: http.Server
afterEach(async () => {
if (server) {
await new Promise((resolve, reject) => {
server.close(err => {
if (err) {
reject(err)
return
}
resolve()