debugbear
Advanced tools
Comparing version 2.0.19 to 2.0.20
@@ -29,2 +29,6 @@ import axios from "axios"; | ||
}, | ||
// Ensure that Axios doesn't make preflight requests | ||
// (I think this happens because Jest makes the env look | ||
// more like a browser than Node) | ||
adapter: require("axios/lib/adapters/http"), | ||
}; | ||
@@ -31,0 +35,0 @@ if (process.env.DEBUG) { |
@@ -61,2 +61,6 @@ "use strict"; | ||
}, | ||
// Ensure that Axios doesn't make preflight requests | ||
// (I think this happens because Jest makes the env look | ||
// more like a browser than Node) | ||
adapter: require("axios/lib/adapters/http"), | ||
}; | ||
@@ -63,0 +67,0 @@ if (process.env.DEBUG) { |
@@ -7,3 +7,4 @@ export interface AnalysisResultObject { | ||
metrics?: any; | ||
oneLineSummary: string; | ||
}; | ||
} |
@@ -55,2 +55,3 @@ "use strict"; | ||
.option("--waitForResult") | ||
.option("--fail", "Return non-zero exit code if build status is 'failure'.") | ||
.option("--inferBuildInfo", "look at environment variables and local git to determine e.g. branch name and commit title") | ||
@@ -95,2 +96,3 @@ .option("--ngrokWebPort <ngrokWebPort>") | ||
isCli: true, | ||
isCliFail: options.fail, | ||
}, { | ||
@@ -119,3 +121,3 @@ customHeaders: options.customHeader, | ||
console.log("\nCLI command failed"); | ||
console.log(err_1.message); | ||
console.log(err_1 && err_1.message); | ||
process.exit(1); | ||
@@ -131,3 +133,3 @@ return [3 /*break*/, 4]; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var dbbClient, analysis; | ||
var dbbClient, analysis, result; | ||
return __generator(this, function (_a) { | ||
@@ -157,5 +159,9 @@ switch (_a.label) { | ||
case 2: | ||
_a.sent(); | ||
result = _a.sent(); | ||
if (options.isCli) { | ||
console.log("Analysis complete"); | ||
console.log("Build complete: ", result.build.oneLineSummary); | ||
console.log("Build status: " + result.build.status); | ||
if (options.isCliFail && result.build.status === "failure") { | ||
process.exit(2); | ||
} | ||
} | ||
@@ -162,0 +168,0 @@ _a.label = 3; |
{ | ||
"name": "debugbear", | ||
"version": "2.0.19", | ||
"version": "2.0.20", | ||
"description": "Use DebugBear to test web performance as part of your Continuous Integration process.", | ||
@@ -21,3 +21,3 @@ "main": "dist/index.js", | ||
"@types/node": "^10.17.28", | ||
"typescript": "^4.2.4" | ||
"typescript": "^4.3.2" | ||
}, | ||
@@ -24,0 +24,0 @@ "bin": { |
@@ -7,3 +7,4 @@ export interface AnalysisResultObject { | ||
metrics?: any; | ||
oneLineSummary: string; | ||
}; | ||
} |
@@ -14,2 +14,3 @@ import * as commander from "commander"; | ||
.option("--waitForResult") | ||
.option("--fail", "Return non-zero exit code if build status is 'failure'.") | ||
.option( | ||
@@ -73,2 +74,3 @@ "--inferBuildInfo", | ||
isCli: true, | ||
isCliFail: options.fail, | ||
}, | ||
@@ -97,3 +99,3 @@ { | ||
console.log("\nCLI command failed"); | ||
console.log(err.message); | ||
console.log(err && err.message); | ||
process.exit(1); | ||
@@ -135,5 +137,10 @@ } | ||
} | ||
await analysis.waitForResult(); | ||
const result = await analysis.waitForResult(); | ||
if (options.isCli) { | ||
console.log("Analysis complete"); | ||
console.log("Build complete: ", result.build!.oneLineSummary); | ||
console.log("Build status: " + result.build!.status); | ||
if (options.isCliFail && result.build!.status === "failure") { | ||
process.exit(2); | ||
} | ||
} | ||
@@ -140,0 +147,0 @@ } |
70858
1955