diff --git a/package.json b/package.json index 8bd32d47..2c529cc5 100644 --- a/package.json +++ b/package.json @@ -15,10 +15,10 @@ "lint:coffee": "resin-lint src/ test/", "lint:typescript": "resin-lint --typescript src/ test/ typings/ && tsc --noEmit", "lint": "npm run lint:coffee && npm run lint:typescript", - "test": "npm run lint && JUNIT_REPORT_PATH=report.xml mocha --exit -r ts-node/register/transpile-only -r coffee-script/register -r register-coffee-coverage test/*.{js,coffee} && npm run coverage", - "test:fast": "mocha --exit -r ts-node/register/transpile-only -r coffee-script/register test/*.{js,coffee}", + "test": "npm run lint && npm run test:build && JUNIT_REPORT_PATH=report.xml istanbul cover _mocha && npm run coverage", + "test:fast": "npm run test:build && mocha", "test:build": "tsc && coffee -m -c -o build . && cp -r test/data build/test/ && cp -r src/migrations build/src && cp package.json build", - "test:debug": "npm run test:build && mocha --inspect-brk build/test/*.js", + "test:debug": "npm run test:build && mocha --inspect-brk", "coverage": "istanbul report text && istanbul report html" }, "private": "true", @@ -85,7 +85,6 @@ "semver-regex": "^1.0.0", "shell-quote": "^1.6.1", "ts-loader": "^3.5.0", - "ts-node": "^7.0.1", "typed-error": "^2.0.0", "typescript": "^3.1.6", "uglifyjs-webpack-plugin": "^1.0.1", diff --git a/src/compose/types/service.ts b/src/compose/types/service.ts index 56fbd2a9..cc46d3b1 100644 --- a/src/compose/types/service.ts +++ b/src/compose/types/service.ts @@ -19,6 +19,15 @@ export interface ServiceHealthcheck { retries?: number; } +export interface ServiceNetworkDictionary { + [networkName: string]: { + aliases?: string[]; + ipv4Address?: string; + ipv6Address?: string; + linkLocalIps?: string[]; + }; +} + // This is the config directly from the compose file (after running it // through _.camelCase) export interface ServiceComposeConfig { @@ -47,16 +56,7 @@ export interface ServiceComposeConfig { labels?: { [labelName: string]: string }; running: boolean; networkMode?: string; - networks?: - | string[] - | { - [networkName: string]: { - aliases?: string[]; - ipv4Address?: string; - ipv6Address?: string; - linkLocalIps?: string[]; - }; - }; + networks?: string[] | ServiceNetworkDictionary; pid?: string; pidsLimit?: number; ports?: string[]; diff --git a/test/mocha.opts b/test/mocha.opts new file mode 100644 index 00000000..ca6014e9 --- /dev/null +++ b/test/mocha.opts @@ -0,0 +1,2 @@ +--exit +build/test/*.js