forked from microsoft/TypeScript-Website
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds visual regression output, spellcheck and prints the test PR via …
…danger
- Loading branch information
Showing
4 changed files
with
1,225 additions
and
25 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// This Dangerfile only runs on same-repo PRs | ||
|
||
// You can test it by running | ||
// yarn danger pr https://github.com/microsoft/TypeScript-Website/pull/115 | ||
|
||
import { danger, message, markdown } from 'danger' | ||
import {basename} from "path" | ||
import spellcheck from 'danger-plugin-spellcheck' | ||
|
||
// Spell check all the things | ||
spellcheck({ | ||
settings: 'artsy/peril-settings@spellcheck.json', | ||
codeSpellCheck: ['Examples/**/*.ts', 'Examples/**/*.js'], | ||
}) | ||
|
||
// Print out the PR url | ||
const deployURL = `https://typescript-v2-${danger.github.pr.number}.ortam.now.sh` | ||
message(`Deployed to [a PR branch](${deployURL})`) | ||
|
||
// Look for new snapshots and show in a HTML table | ||
const snapshots = danger.git.fileMatch("packages/typescriptlang-org/_tests/backstop_data/bitmaps_reference/*.png") | ||
if (snapshots.modified) { | ||
const oldSha = danger.github.pr.base.sha | ||
const newSha = danger.github.pr.head.sha | ||
|
||
const tables = snapshots.getKeyedPaths().modified.map(p => { | ||
const oldURL = `https://raw.githubusercontent.com/microsoft/TypeScript-Website/${oldSha}/${p}` | ||
const newURL = `https://raw.githubusercontent.com/microsoft/TypeScript-Website/${newSha}/${p}` | ||
|
||
return ` | ||
###### \`${basename(p)}\` | ||
Before | After | ||
:-------------------------:|:-------------------------: | ||
![](${oldURL}) | ![](${newURL}) | ||
` | ||
}) | ||
|
||
markdown(`## Snapshots updated\n\n ${tables.join("\n\n")}`) | ||
} |
This file contains 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
Oops, something went wrong.