Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/danger/danger-js into fix…
Browse files Browse the repository at this point in the history
…_cli
  • Loading branch information
orta committed Jan 3, 2018
2 parents 7af7f06 + 67af84b commit db8a374
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/guides/the_dangerfile.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ blurb: Step two on using Danger in your app, how to work locally and nuances aro

The Danger JS DSL is fully typed via TypeScript. These definitions are shipped with the Danger module. If your text editor supports working with type definitions you will get inline-documentation and auto-completion after you import danger in your Dangerfile. Visual Studios Code will do this by default for you.

If you are using Babel in your project, your Dangerfile will use the same transpilation settings. If you're using TypeScript + Jest it will work out of the box too, however, if you don't, you should head over to the [TypeScript guide][ts_guide]
If you are using Babel in your project, your Dangerfile will use the same transpilation settings. If you're using TypeScript + Jest it will work out of the box too, however, if you don't, you should head over to the [transpilation guide][transpilation_guide]

## Working on your Dangerfile

Expand Down Expand Up @@ -105,5 +105,5 @@ Some TypeScript examples:
[rxjs]: https://github.com/ReactiveX/rxjs/blob/master/dangerfile.js
[setup]: http://danger.systems/guides/getting_started.html#creating-a-bot-account-for-danger-to-use
[jest]: https://github.com/facebook/jest
[ts_guide]: /js/tutorials/typescript.html
[transpilation_guide]: /js/tutorials/transiplation.html
[changelog]: http://danger.systems/js/changelog.html
10 changes: 8 additions & 2 deletions source/platforms/github/_tests/_github_git.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,19 @@ import { GitDSL } from "../../../dsl/GitDSL"

const fixtures = resolve(__dirname, "..", "..", "_tests", "fixtures")

/** Returns a fixture. */
const loadFixture = (path: string): string =>
readFileSync(pathJoin(fixtures, path), {})
.toString()
.replace(/\r/g, "")

/** Returns JSON from the fixtured dir */
export const requestWithFixturedJSON = async (path: string): Promise<() => Promise<any>> => () =>
Promise.resolve(JSON.parse(readFileSync(pathJoin(fixtures, path), {}).toString()))
Promise.resolve(JSON.parse(loadFixture(path)))

/** Returns arbitrary text value from a request */
export const requestWithFixturedContent = async (path: string): Promise<() => Promise<string>> => () =>
Promise.resolve(readFileSync(pathJoin(fixtures, path), {}).toString())
Promise.resolve(loadFixture(path))

/**
* HACKish: Jest on Windows seems to include some additional
Expand Down

0 comments on commit db8a374

Please sign in to comment.