Created
March 24, 2020 15:15
-
-
Save vuldin/79a5d2966f4489bc43bd4a44bf8df440 to your computer and use it in GitHub Desktop.
Testing debugbear javscript API
This file contains hidden or 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
const { DebugBear } = require("debugbear"); | |
const envCi = require("env-ci"); | |
// DEBUGBEAR_API_KEY=<key> $(npm bin)/debugbear --pageId=6383 --waitForResult --baseBranch=master --inferBuildInfo | |
// https://www.debugbear.com/viewResult/969114 | |
(async function run() { | |
const { commit: commitHash } = envCi(); | |
console.log(`commitHash: ${commitHash}`); | |
const debugbear = new DebugBear(process.env.DEBUGBEAR_API_KEY); | |
const analysis = await debugbear.pages.analyze(6383, { | |
// Commit Hash is required to generate a build | |
commitHash, | |
customHeaders: { | |
"X-Enable-Experiment": "true" | |
} | |
}); | |
const result = await analysis.waitForResult(); | |
console.log(result); | |
console.log(result.build.status); // "success" | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment