Skip to content

Commit

Permalink
Make it easier to write tests against the Executor by returning value…
Browse files Browse the repository at this point in the history
…s more often
  • Loading branch information
orta committed Mar 22, 2017
1 parent 603cb82 commit 5cb2af1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions source/runner/Executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ export class Executor {
/** Mainly just a dumb helper because I can't do
* async functions in danger-run.js
* @param {string} file the path to run Danger from
* @returns {void} It's a promise, so a void promise
* @returns {Promise<DangerResults>} The results of the Danger run
*/
async setupAndRunDanger(file: string) {
const runtimeEnv = await this.setupDanger()
await this.runDanger(file, runtimeEnv)
return await this.runDanger(file, runtimeEnv)
}

/**
Expand All @@ -49,12 +49,13 @@ export class Executor {
/**
* Runs all of the operations for a running just Danger
* @param {string} file the filepath to the Dangerfile
* @returns {void} It's a promise, so a void promise
* @returns {Promise<DangerResults>} The results of the Danger run
*/

async runDanger(file: string, runtime: DangerfileRuntimeEnv) {
const results = await runDangerfileEnvironment(file, runtime)
await this.handleResults(results)
return results
}

/**
Expand Down

0 comments on commit 5cb2af1

Please sign in to comment.