From 603cb82846680f85528842762ceeff3829c6e74a Mon Sep 17 00:00:00 2001 From: Orta Therox Date: Tue, 21 Mar 2017 16:34:41 +0000 Subject: [PATCH 01/12] Make the GitHub API not rely on a CI instance, but on an interface which it cares about --- package.json | 2 +- source/ci_source/ci_source.ts | 13 +- source/ci_source/ci_source_helpers.ts | 6 +- source/platforms/_tests/GitHub.test.ts | 3 +- source/platforms/github/GitHubAPI.ts | 46 +-- .../github/_tests/_GitHubAPI.test.ts | 7 +- yarn.lock | 263 ++++++++++-------- 7 files changed, 188 insertions(+), 152 deletions(-) diff --git a/package.json b/package.json index 8a8b2e653..37d252731 100644 --- a/package.json +++ b/package.json @@ -92,7 +92,7 @@ "shx": "^0.2.1", "ts-jest": "^19.0.0", "ts-node": "^3.0.0", - "tslint": "^4.4.0", + "tslint": "^4.5.1", "typescript": "2.2.1" }, "dependencies": { diff --git a/source/ci_source/ci_source.ts b/source/ci_source/ci_source.ts index b664c2a0b..cc95f7568 100644 --- a/source/ci_source/ci_source.ts +++ b/source/ci_source/ci_source.ts @@ -1,6 +1,15 @@ + /** A json object that represents the outer ENV */ export type Env = any +/** Key details about a repo */ +export interface RepoMetaData { + /** A path like "artsy/eigen" */ + repoSlug: string, + /** The ID for the pull/merge request "11" */ + pullRequestID: string +} + /** The shape of an object that represents an individual CI */ export interface CISource { /** The project name, mainly for showing errors */ @@ -12,13 +21,13 @@ export interface CISource { /** Does this validate as being on a particular PR on a CI? */ readonly isPR: boolean - /** What is the reference slug for this environment? */ + // /** What is the reference slug for this environment? */ readonly repoSlug: string /** What platforms can this CI communicate with? */ readonly supportedPlatforms: Array - /** What unique id can be found for the code review platform's PR */ + // /** What unique id can be found for the code review platform's PR */ readonly pullRequestID: string /** allows the source to do some setup */ diff --git a/source/ci_source/ci_source_helpers.ts b/source/ci_source/ci_source_helpers.ts index a8d240315..28c87e0f5 100644 --- a/source/ci_source/ci_source_helpers.ts +++ b/source/ci_source/ci_source_helpers.ts @@ -1,4 +1,4 @@ -import { Env, CISource } from "./ci_source" +import { Env, RepoMetaData } from "./ci_source" import { GitHubAPI } from "../platforms/github/GitHubAPI" import { GitHubPRDSL } from "../dsl/GitHubDSL" import * as find from "lodash.find" @@ -42,12 +42,12 @@ export function ensureEnvKeysAreInt(env: Env, keys: Array): boolean { * @returns {number} The pull request ID, if any. Otherwise 0 (Github starts from #1). * If there are multiple pull requests open for a branch, returns the first. */ -export async function getPullRequestIDForBranch(source: CISource, env: Env, branch: string): Promise { +export async function getPullRequestIDForBranch(metadata: RepoMetaData, env: Env, branch: string): Promise { const token = env["DANGER_GITHUB_API_TOKEN"] if (!token) { return 0 } - const api = new GitHubAPI(source, token) + const api = new GitHubAPI(metadata, token) const prs = await api.getPullRequests() as any[] const prForBranch: GitHubPRDSL = find(prs, (pr: GitHubPRDSL) => pr.head.ref === branch) if (prForBranch) { diff --git a/source/platforms/_tests/GitHub.test.ts b/source/platforms/_tests/GitHub.test.ts index 4193c5fc7..934608d80 100644 --- a/source/platforms/_tests/GitHub.test.ts +++ b/source/platforms/_tests/GitHub.test.ts @@ -17,8 +17,7 @@ export const requestWithFixturedJSON = async (path: string): Promise<() => Promi describe("with fixtured data", () => { it("returns the correct github data", async () => { - const mockSource = new FakeCI({}) - const api = new GitHubAPI(mockSource) + const api = new GitHubAPI({ repoSlug: "unused/metadata", pullRequestID: "1" }) const github = new GitHub(api) api.getPullRequestInfo = await requestWithFixturedJSON("github_pr.json") diff --git a/source/platforms/github/GitHubAPI.ts b/source/platforms/github/GitHubAPI.ts index a5be58e9e..7b13b4594 100644 --- a/source/platforms/github/GitHubAPI.ts +++ b/source/platforms/github/GitHubAPI.ts @@ -1,6 +1,6 @@ import { api as fetch } from "../../api/fetch" -import { CISource } from "../../ci_source/ci_source" -import { GitHubPRDSL} from "../../dsl/GitHubDSL" +import { RepoMetaData } from "../../ci_source/ci_source" +import { GitHubPRDSL, GitHubUser} from "../../dsl/GitHubDSL" import * as find from "lodash.find" // The Handle the API specific parts of the github @@ -16,7 +16,7 @@ export class GitHubAPI { fetch: typeof fetch additionalHeaders: any - constructor(public readonly ciSource: CISource, public readonly token?: APIToken) { + constructor(public readonly repoMetadata: RepoMetaData, public readonly token?: APIToken) { // This allows Peril to DI in a new Fetch function // which can handle unique API edge-cases around integrations this.fetch = fetch @@ -54,7 +54,7 @@ export class GitHubAPI { } async updateCommentWithID(id: number, comment: string): Promise { - const repo = this.ciSource.repoSlug + const repo = this.repoMetadata.repoSlug const res = await this.patch(`repos/${repo}/issues/comments/${id}`, {}, { body: comment }) @@ -63,7 +63,7 @@ export class GitHubAPI { } async deleteCommentWithID(id: number): Promise { - const repo = this.ciSource.repoSlug + const repo = this.repoMetadata.repoSlug const res = await this.api(`repos/${repo}/issues/comments/${id}`, {}, {}, "DELETE") return res.json() @@ -75,8 +75,8 @@ export class GitHubAPI { } async postPRComment(comment: string): Promise { - const repo = this.ciSource.repoSlug - const prID = this.ciSource.pullRequestID + const repo = this.repoMetadata.repoSlug + const prID = this.repoMetadata.pullRequestID const res = await this.post(`repos/${repo}/issues/${prID}/comments`, {}, { body: comment }) @@ -85,22 +85,22 @@ export class GitHubAPI { } async getPullRequestInfo(): Promise { - const repo = this.ciSource.repoSlug - const prID = this.ciSource.pullRequestID + const repo = this.repoMetadata.repoSlug + const prID = this.repoMetadata.pullRequestID const res = await this.get(`repos/${repo}/pulls/${prID}`) return res.ok ? res.json() : {} } async getPullRequestCommits(): Promise { - const repo = this.ciSource.repoSlug - const prID = this.ciSource.pullRequestID + const repo = this.repoMetadata.repoSlug + const prID = this.repoMetadata.pullRequestID const res = await this.get(`repos/${repo}/pulls/${prID}/commits`) return res.ok ? res.json() : [] } - async getUserInfo(): Promise { + async getUserInfo(): Promise { const response: any = await this.get("user") return response.json() @@ -108,16 +108,16 @@ export class GitHubAPI { // TODO: This does not handle pagination async getPullRequestComments(): Promise { - const repo = this.ciSource.repoSlug - const prID = this.ciSource.pullRequestID + const repo = this.repoMetadata.repoSlug + const prID = this.repoMetadata.pullRequestID const res = await this.get(`repos/${repo}/issues/${prID}/comments`) return res.ok ? res.json() : [] } async getPullRequestDiff(): Promise { - const repo = this.ciSource.repoSlug - const prID = this.ciSource.pullRequestID + const repo = this.repoMetadata.repoSlug + const prID = this.repoMetadata.pullRequestID const res = await this.get(`repos/${repo}/pulls/${prID}`, { accept: "application/vnd.github.v3.diff" }) @@ -131,15 +131,15 @@ export class GitHubAPI { } async getPullRequests(): Promise { - const repo = this.ciSource.repoSlug + const repo = this.repoMetadata.repoSlug const res = await this.get(`repos/${repo}/pulls`) return res.ok ? res.json : [] } async getReviewerRequests(): Promise { - const repo = this.ciSource.repoSlug - const prID = this.ciSource.pullRequestID + const repo = this.repoMetadata.repoSlug + const prID = this.repoMetadata.pullRequestID const res = await this.get(`repos/${repo}/pulls/${prID}/requested_reviewers`, { accept: "application/vnd.github.black-cat-preview+json" }) @@ -148,8 +148,8 @@ export class GitHubAPI { } async getReviews(): Promise { - const repo = this.ciSource.repoSlug - const prID = this.ciSource.pullRequestID + const repo = this.repoMetadata.repoSlug + const prID = this.repoMetadata.pullRequestID const res = await this.get(`repos/${repo}/pulls/${prID}/reviews`, { accept: "application/vnd.github.black-cat-preview+json" }) @@ -158,8 +158,8 @@ export class GitHubAPI { } async getIssue(): Promise { - const repo = this.ciSource.repoSlug - const prID = this.ciSource.pullRequestID + const repo = this.repoMetadata.repoSlug + const prID = this.repoMetadata.pullRequestID const res = await this.get(`repos/${repo}/issues/${prID}`) return res.ok ? res.json() : { labels: [] } diff --git a/source/platforms/github/_tests/_GitHubAPI.test.ts b/source/platforms/github/_tests/_GitHubAPI.test.ts index 25753050c..30aac3b95 100644 --- a/source/platforms/github/_tests/_GitHubAPI.test.ts +++ b/source/platforms/github/_tests/_GitHubAPI.test.ts @@ -19,8 +19,7 @@ const fetch = (api, params): Promise => { } it("fileContents expects to grab PR JSON and pull out a file API call", async () => { - const mockSource = new FakeCI({}) - const api = new GitHubAPI(mockSource, "token") + const api = new GitHubAPI({ repoSlug: "unused/metadata", pullRequestID: "1" }, "token") api.getPullRequestInfo = await requestWithFixturedJSON("github_pr.json") api.getFileContents = await requestWithFixturedJSON("static_file.json") @@ -33,9 +32,7 @@ describe("API testing", () => { let api: GitHubAPI beforeEach(() => { - const mockSource = new FakeCI({}) - - api = new GitHubAPI(mockSource, "ABCDE") + api = new GitHubAPI({ repoSlug: "artsy/emission", pullRequestID: "1" }, "ABCDE") }) it("getUserInfo", async () => { diff --git a/yarn.lock b/yarn.lock index a7bd941dd..444bc2929 100644 --- a/yarn.lock +++ b/yarn.lock @@ -94,7 +94,7 @@ ansi-styles@^3.0.0: dependencies: color-convert "^1.0.0" -any-promise@^1.0.0, any-promise@^1.3.0: +any-promise@^1.0.0: version "1.3.0" resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f" @@ -828,18 +828,16 @@ boom@2.x.x: dependencies: hoek "2.x.x" -boxen@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/boxen/-/boxen-0.6.0.tgz#8364d4248ac34ff0ef1b2f2bf49a6c60ce0d81b6" +boxen@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/boxen/-/boxen-1.0.0.tgz#b2694baf1f605f708ff0177c12193b22f29aaaab" dependencies: ansi-align "^1.1.0" - camelcase "^2.1.0" + camelcase "^4.0.0" chalk "^1.1.1" cli-boxes "^1.0.0" - filled-array "^1.0.0" - object-assign "^4.0.1" - repeating "^2.0.0" - string-width "^1.0.1" + string-width "^2.0.0" + term-size "^0.1.0" widest-line "^1.0.0" brace-expansion@^1.0.0: @@ -898,7 +896,7 @@ camelcase@^1.0.2: version "1.2.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" -camelcase@^2.0.0, camelcase@^2.1.0: +camelcase@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" @@ -906,6 +904,10 @@ camelcase@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a" +camelcase@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.0.0.tgz#8b0f90d44be5e281b903b9887349b92595ef07f2" + capture-stack-trace@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/capture-stack-trace/-/capture-stack-trace-1.0.0.tgz#4a6fa07399c26bba47f0b2496b4d0fb408c5550d" @@ -1043,19 +1045,16 @@ concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" -configstore@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/configstore/-/configstore-2.1.0.tgz#737a3a7036e9886102aa6099e47bb33ab1aba1a1" +configstore@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/configstore/-/configstore-3.0.0.tgz#e1b8669c1803ccc50b545e92f8e6e79aa80e0196" dependencies: - dot-prop "^3.0.0" + dot-prop "^4.1.0" graceful-fs "^4.1.2" mkdirp "^0.5.0" - object-assign "^4.0.1" - os-tmpdir "^1.0.0" - osenv "^0.1.0" - uuid "^2.0.1" + unique-string "^1.0.0" write-file-atomic "^1.1.2" - xdg-basedir "^2.0.0" + xdg-basedir "^3.0.0" console-control-strings@^1.0.0, console-control-strings@~1.1.0: version "1.1.0" @@ -1090,12 +1089,19 @@ cosmiconfig@^1.1.0: pinkie-promise "^2.0.0" require-from-string "^1.1.0" -create-error-class@^3.0.1: +create-error-class@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/create-error-class/-/create-error-class-3.0.2.tgz#06be7abef947a3f14a30fd610671d401bca8b7b6" dependencies: capture-stack-trace "^1.0.0" +cross-spawn-async@^2.1.1: + version "2.2.5" + resolved "https://registry.yarnpkg.com/cross-spawn-async/-/cross-spawn-async-2.2.5.tgz#845ff0c0834a3ded9d160daca6d390906bb288cc" + dependencies: + lru-cache "^4.0.0" + which "^1.2.8" + cross-spawn@^4.0.0: version "4.0.2" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-4.0.2.tgz#7b9247621c23adfdd3856004a823cbe397424d41" @@ -1109,6 +1115,10 @@ cryptiles@2.x.x: dependencies: boom "2.x.x" +crypto-random-string@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-1.0.0.tgz#a230f64f568310e1498009940790ec99545bca7e" + cssom@0.3.x, "cssom@>= 0.3.0 < 0.4.0": version "0.3.1" resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.1.tgz#c9e37ef2490e64f6d1baa10fda852257082c25d3" @@ -1235,9 +1245,9 @@ diff@^3.0.0, diff@^3.0.1, diff@^3.1.0: version "3.2.0" resolved "https://registry.yarnpkg.com/diff/-/diff-3.2.0.tgz#c9ce393a4b7cbd0b058a725c93df299027868ff9" -dot-prop@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-3.0.0.tgz#1b708af094a49c9a0e7dbcad790aba539dac1177" +dot-prop@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-4.1.1.tgz#a8493f0b7b5eeec82525b5c7587fa7de7ca859c1" dependencies: is-obj "^1.0.0" @@ -1247,11 +1257,9 @@ duplexer2@0.0.2: dependencies: readable-stream "~1.1.9" -duplexer2@^0.1.4: +duplexer3@^0.1.4: version "0.1.4" - resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.1.4.tgz#8b12dab878c0d69e3e7891051662a32fc6bddcc1" - dependencies: - readable-stream "^2.0.2" + resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" ecc-jsbn@~0.1.1: version "0.1.1" @@ -1331,6 +1339,17 @@ exec-sh@^0.2.0: dependencies: merge "^1.1.3" +execa@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-0.4.0.tgz#4eb6467a36a095fabb2970ff9d5e3fb7bce6ebc3" + dependencies: + cross-spawn-async "^2.1.1" + is-stream "^1.1.0" + npm-run-path "^1.0.0" + object-assign "^4.0.1" + path-key "^1.0.0" + strip-eof "^1.0.0" + execa@^0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/execa/-/execa-0.5.0.tgz#a57456764b990e3e52f6eff7f17a9cc2ff2e7ccc" @@ -1444,10 +1463,6 @@ fill-range@^2.1.0: repeat-element "^1.1.2" repeat-string "^1.5.2" -filled-array@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/filled-array/-/filled-array-1.1.0.tgz#c3c4f6c663b923459a9aa29912d2d031f1507f84" - find-parent-dir@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/find-parent-dir/-/find-parent-dir-0.3.0.tgz#33c44b429ab2b2f0646299c5f9f718f376ff8d54" @@ -1586,6 +1601,10 @@ get-stream@^2.2.0: object-assign "^4.0.1" pinkie-promise "^2.0.0" +get-stream@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" + getpass@^0.1.1: version "0.1.6" resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.6.tgz#283ffd9fc1256840875311c1b60e8c40187110e6" @@ -1649,24 +1668,20 @@ gonzales-pe@^3.4.4: dependencies: minimist "1.1.x" -got@^5.0.0: - version "5.7.1" - resolved "https://registry.yarnpkg.com/got/-/got-5.7.1.tgz#5f81635a61e4a6589f180569ea4e381680a51f35" +got@^6.7.1: + version "6.7.1" + resolved "https://registry.yarnpkg.com/got/-/got-6.7.1.tgz#240cd05785a9a18e561dc1b44b41c763ef1e8db0" dependencies: - create-error-class "^3.0.1" - duplexer2 "^0.1.4" + create-error-class "^3.0.0" + duplexer3 "^0.1.4" + get-stream "^3.0.0" is-redirect "^1.0.0" is-retry-allowed "^1.0.0" is-stream "^1.0.0" lowercase-keys "^1.0.0" - node-status-codes "^1.0.0" - object-assign "^4.0.1" - parse-json "^2.1.0" - pinkie-promise "^2.0.0" - read-all-stream "^3.0.0" - readable-stream "^2.0.5" - timed-out "^3.0.0" - unzip-response "^1.0.2" + safe-buffer "^5.0.1" + timed-out "^4.0.0" + unzip-response "^2.0.1" url-parse-lax "^1.0.0" graceful-fs@^4.1.2, graceful-fs@^4.1.4, graceful-fs@^4.1.6: @@ -1914,6 +1929,10 @@ is-fullwidth-code-point@^1.0.0: dependencies: number-is-nan "^1.0.0" +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + is-glob@^2.0.0, is-glob@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" @@ -2552,19 +2571,19 @@ kind-of@^3.0.2: dependencies: is-buffer "^1.0.2" -latest-version@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-2.0.0.tgz#56f8d6139620847b8017f8f1f4d78e211324168b" +latest-version@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-3.0.0.tgz#3104f008c0c391084107f85a344bc61e38970649" dependencies: - package-json "^2.0.0" + package-json "^3.0.0" lazy-cache@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" -lazy-req@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/lazy-req/-/lazy-req-1.1.0.tgz#bdaebead30f8d824039ce0ce149d4daa07ba1fac" +lazy-req@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/lazy-req/-/lazy-req-2.0.0.tgz#c9450a363ecdda2e6f0c70132ad4f37f8f06f2b4" lcid@^1.0.0: version "1.0.0" @@ -2817,7 +2836,7 @@ lowercase-keys@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.0.tgz#4e3366b39e7f5457e35f1324bdf6f88d0bfc7306" -lru-cache@^4.0.1: +lru-cache@^4.0.0, lru-cache@^4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.0.2.tgz#1d17679c069cda5d040991a09dbc2c0db377e55e" dependencies: @@ -3030,10 +3049,6 @@ node-source-walk@^3.0.0, node-source-walk@^3.2.0: dependencies: babylon "~6.8.1" -node-status-codes@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/node-status-codes/-/node-status-codes-1.0.0.tgz#5ae5541d024645d32a58fcddc9ceecea7ae3ac2f" - nopt@3.x, nopt@~3.0.6: version "3.0.6" resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" @@ -3063,6 +3078,12 @@ npm-path@^2.0.2: dependencies: which "^1.2.10" +npm-run-path@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-1.0.0.tgz#f5c32bf595fe81ae927daec52e82f8b000ac3c8f" + dependencies: + path-key "^1.0.0" + npm-run-path@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" @@ -3170,17 +3191,10 @@ os-locale@^1.4.0: dependencies: lcid "^1.0.0" -os-tmpdir@^1.0.0, os-tmpdir@^1.0.1: +os-tmpdir@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" -osenv@^0.1.0: - version "0.1.4" - resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.4.tgz#42fe6d5953df06c8064be6f176c3d05aaaa34644" - dependencies: - os-homedir "^1.0.0" - os-tmpdir "^1.0.0" - output-file-sync@^1.1.0: version "1.1.2" resolved "https://registry.yarnpkg.com/output-file-sync/-/output-file-sync-1.1.2.tgz#d0a33eefe61a205facb90092e826598d5245ce76" @@ -3199,11 +3213,11 @@ p-locate@^2.0.0: dependencies: p-limit "^1.1.0" -package-json@^2.0.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/package-json/-/package-json-2.4.0.tgz#0d15bd67d1cbbddbb2ca222ff2edb86bcb31a8bb" +package-json@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/package-json/-/package-json-3.1.0.tgz#ce281900fe8052150cc6709c6c006c18fdb2f379" dependencies: - got "^5.0.0" + got "^6.7.1" registry-auth-token "^3.0.1" registry-url "^3.0.3" semver "^5.1.0" @@ -3221,7 +3235,7 @@ parse-glob@^3.0.4: is-extglob "^1.0.0" is-glob "^2.0.0" -parse-json@^2.1.0, parse-json@^2.2.0: +parse-json@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" dependencies: @@ -3245,6 +3259,10 @@ path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" +path-key@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-1.0.0.tgz#5d53d578019646c0d68800db4e146e6bdc2ac7af" + path-key@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" @@ -3354,13 +3372,6 @@ rc@^1.0.1, rc@^1.1.6, rc@~1.1.6: minimist "^1.2.0" strip-json-comments "~1.0.4" -read-all-stream@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/read-all-stream/-/read-all-stream-3.1.0.tgz#35c3e177f2078ef789ee4bfafa4373074eaef4fa" - dependencies: - pinkie-promise "^2.0.0" - readable-stream "^2.0.0" - read-pkg-up@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" @@ -3376,7 +3387,7 @@ read-pkg@^1.0.0: normalize-package-data "^2.3.2" path-type "^1.0.0" -readable-stream@^2.0.0, "readable-stream@^2.0.0 || ^1.1.13", readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.5: +"readable-stream@^2.0.0 || ^1.1.13", readable-stream@^2.0.1, readable-stream@^2.0.2: version "2.2.2" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.2.tgz#a9e6fec3c7dda85f8bb1b3ba7028604556fc825e" dependencies: @@ -3621,6 +3632,10 @@ rxjs@^5.0.0-beta.11: dependencies: symbol-observable "^1.0.1" +safe-buffer@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.0.1.tgz#d263ca54696cd8a306b5ca6551e92de57918fbe7" + sane@~1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/sane/-/sane-1.4.1.tgz#88f763d74040f5f0c256b6163db399bf110ac715" @@ -3796,6 +3811,13 @@ string-width@^1.0.1, string-width@^1.0.2: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" +string-width@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.0.0.tgz#635c5436cc72a6e0c387ceca278d4e2eec52687e" + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^3.0.0" + string_decoder@~0.10.x: version "0.10.31" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" @@ -3814,7 +3836,7 @@ strip-ansi@^3.0.0, strip-ansi@^3.0.1: dependencies: ansi-regex "^2.0.0" -strip-bom@3.0.0: +strip-bom@3.0.0, strip-bom@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" @@ -3901,6 +3923,12 @@ temp@~0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/temp/-/temp-0.4.0.tgz#671ad63d57be0fe9d7294664b3fc400636678a60" +term-size@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/term-size/-/term-size-0.1.1.tgz#87360b96396cab5760963714cda0d0cbeecad9ca" + dependencies: + execa "^0.4.0" + test-exclude@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-3.3.0.tgz#7a17ca1239988c98367b0621456dbb7d4bc38977" @@ -3948,9 +3976,9 @@ time-stamp@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/time-stamp/-/time-stamp-1.0.1.tgz#9f4bd23559c9365966f3302dbba2b07c6b99b151" -timed-out@^3.0.0: - version "3.1.3" - resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-3.1.3.tgz#95860bfcc5c76c277f8f8326fd0f5b2e20eba217" +timed-out@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" tmpl@1.0.x: version "1.0.4" @@ -3994,9 +4022,9 @@ ts-jest@^19.0.0: source-map-support "^0.4.4" yargs "^6.1.1" -ts-node@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-2.1.0.tgz#aa2bf4b2e25c5fb6a7c54701edc3666d3a9db25d" +ts-node@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-3.0.0.tgz#7d1ef931dc8e2508add402b9d4ffc943228740a5" dependencies: arrify "^1.0.0" chalk "^1.1.1" @@ -4006,23 +4034,21 @@ ts-node@^2.1.0: mkdirp "^0.5.1" pinkie "^2.0.4" source-map-support "^0.4.0" - tsconfig "^5.0.2" + tsconfig "^6.0.0" v8flags "^2.0.11" xtend "^4.0.0" yn "^1.2.0" -tsconfig@^5.0.2: - version "5.0.3" - resolved "https://registry.yarnpkg.com/tsconfig/-/tsconfig-5.0.3.tgz#5f4278e701800967a8fc383fd19648878f2a6e3a" +tsconfig@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/tsconfig/-/tsconfig-6.0.0.tgz#6b0e8376003d7af1864f8df8f89dd0059ffcd032" dependencies: - any-promise "^1.3.0" - parse-json "^2.2.0" - strip-bom "^2.0.0" + strip-bom "^3.0.0" strip-json-comments "^2.0.0" -tslint@^4.4.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/tslint/-/tslint-4.4.0.tgz#748d17bf8598dd044cca5771a03353ea422da29e" +tslint@^4.5.1: + version "4.5.1" + resolved "https://registry.yarnpkg.com/tslint/-/tslint-4.5.1.tgz#05356871bef23a434906734006fc188336ba824b" dependencies: babel-code-frame "^6.20.0" colors "^1.1.2" @@ -4031,7 +4057,12 @@ tslint@^4.4.0: glob "^7.1.1" optimist "~0.6.0" resolve "^1.1.7" - update-notifier "^1.0.2" + tsutils "^1.1.0" + update-notifier "^2.0.0" + +tsutils@^1.1.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-1.4.0.tgz#84f8a83df9967d35bf1ff3aa48c7339593d64e19" tunnel-agent@~0.4.1: version "0.4.3" @@ -4068,22 +4099,28 @@ uid-number@~0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/uid-number/-/uid-number-0.0.6.tgz#0ea10e8035e8eb5b8e4449f06da1c730663baa81" -unzip-response@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/unzip-response/-/unzip-response-1.0.2.tgz#b984f0877fc0a89c2c773cc1ef7b5b232b5b06fe" +unique-string@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unique-string/-/unique-string-1.0.0.tgz#9e1057cca851abb93398f8b33ae187b99caec11a" + dependencies: + crypto-random-string "^1.0.0" -update-notifier@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-1.0.3.tgz#8f92c515482bd6831b7c93013e70f87552c7cf5a" +unzip-response@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/unzip-response/-/unzip-response-2.0.1.tgz#d2f0f737d16b0615e72a6935ed04214572d56f97" + +update-notifier@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-2.1.0.tgz#ec0c1e53536b76647a24b77cb83966d9315123d9" dependencies: - boxen "^0.6.0" + boxen "^1.0.0" chalk "^1.0.0" - configstore "^2.0.0" + configstore "^3.0.0" is-npm "^1.0.0" - latest-version "^2.0.0" - lazy-req "^1.1.0" + latest-version "^3.0.0" + lazy-req "^2.0.0" semver-diff "^2.0.0" - xdg-basedir "^2.0.0" + xdg-basedir "^3.0.0" url-parse-lax@^1.0.0: version "1.0.0" @@ -4099,10 +4136,6 @@ util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" -uuid@^2.0.1: - version "2.0.3" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.3.tgz#67e2e863797215530dff318e5bf9dcebfd47b21a" - uuid@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1" @@ -4184,7 +4217,7 @@ which-module@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f" -which@^1.1.1, which@^1.2.10, which@^1.2.11, which@^1.2.12, which@^1.2.9: +which@^1.1.1, which@^1.2.10, which@^1.2.11, which@^1.2.12, which@^1.2.8, which@^1.2.9: version "1.2.12" resolved "https://registry.yarnpkg.com/which/-/which-1.2.12.tgz#de67b5e450269f194909ef23ece4ebe416fa1192" dependencies: @@ -4248,11 +4281,9 @@ write-file-atomic@^1.1.2: imurmurhash "^0.1.4" slide "^1.1.5" -xdg-basedir@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-2.0.0.tgz#edbc903cc385fc04523d966a335504b5504d1bd2" - dependencies: - os-homedir "^1.0.0" +xdg-basedir@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-3.0.0.tgz#496b2cc109eca8dbacfe2dc72b603c17c5870ad4" "xml-name-validator@>= 2.0.1 < 3.0.0", xml-name-validator@^2.0.1: version "2.0.1" From 5cb2af1a02847eac07b334ce9963076f44c69089 Mon Sep 17 00:00:00 2001 From: Orta Therox Date: Wed, 22 Mar 2017 08:12:21 +0000 Subject: [PATCH 02/12] Make it easier to write tests against the Executor by returning values more often --- source/runner/Executor.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/runner/Executor.ts b/source/runner/Executor.ts index d46065294..64d59c5be 100644 --- a/source/runner/Executor.ts +++ b/source/runner/Executor.ts @@ -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} 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) } /** @@ -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} The results of the Danger run */ async runDanger(file: string, runtime: DangerfileRuntimeEnv) { const results = await runDangerfileEnvironment(file, runtime) await this.handleResults(results) + return results } /** From 98a371e9d78f5cf06ba7ad7e2b505452370c6921 Mon Sep 17 00:00:00 2001 From: Orta Therox Date: Wed, 22 Mar 2017 09:12:49 +0000 Subject: [PATCH 03/12] Add more fixtures --- package.json | 10 +- source/ci_source/ci_source.ts | 4 +- source/platforms/_tests/fixtures/readme.md | 5 + .../_tests/fixtures/requested_reviewers.json | 21 + source/platforms/_tests/fixtures/reviews.json | 146 ++++ source/runner/types.ts | 13 + yarn.lock | 716 ++++++++++-------- 7 files changed, 603 insertions(+), 312 deletions(-) create mode 100644 source/platforms/_tests/fixtures/readme.md create mode 100644 source/platforms/_tests/fixtures/requested_reviewers.json create mode 100644 source/platforms/_tests/fixtures/reviews.json diff --git a/package.json b/package.json index 37d252731..73380bc44 100644 --- a/package.json +++ b/package.json @@ -78,12 +78,12 @@ "@types/debug": "0.0.29", "@types/jest": "^19.2.1", "@types/node-fetch": "^1.6.6", - "babel-cli": "^6.16.0", + "babel-cli": "6.16", "babel-plugin-syntax-async-functions": "^6.13.0", - "babel-plugin-transform-flow-strip-types": "^6.8.0", - "babel-plugin-transform-regenerator": "^6.16.1", - "babel-preset-es2015": "^6.16.0", - "babel-preset-stage-3": "^6.17.0", + "babel-plugin-transform-flow-strip-types": "^6.22.0", + "babel-plugin-transform-regenerator": "^6.22.0", + "babel-preset-es2015": "^6.24.0", + "babel-preset-stage-3": "^6.22.0", "husky": "^0.12.0", "in-publish": "^2.0.0", "jest": "^19.0.2", diff --git a/source/ci_source/ci_source.ts b/source/ci_source/ci_source.ts index cc95f7568..e1776ed60 100644 --- a/source/ci_source/ci_source.ts +++ b/source/ci_source/ci_source.ts @@ -21,13 +21,13 @@ export interface CISource { /** Does this validate as being on a particular PR on a CI? */ readonly isPR: boolean - // /** What is the reference slug for this environment? */ + /** What is the reference slug for this environment? */ readonly repoSlug: string /** What platforms can this CI communicate with? */ readonly supportedPlatforms: Array - // /** What unique id can be found for the code review platform's PR */ + /** What unique id can be found for the code review platform's PR */ readonly pullRequestID: string /** allows the source to do some setup */ diff --git a/source/platforms/_tests/fixtures/readme.md b/source/platforms/_tests/fixtures/readme.md new file mode 100644 index 000000000..315d23675 --- /dev/null +++ b/source/platforms/_tests/fixtures/readme.md @@ -0,0 +1,5 @@ +Here's an example CURL request to add a new fixture + +```sh +curl -H "Authorization: XXX" curl -H "Accept: application/vnd.github.black-cat-preview+json" --request GET https://api.github.com/repos/artsy/emission/pulls/327/requested_reviewers > source/platforms/_tests/fixtures/requested_reviewers.json +``` diff --git a/source/platforms/_tests/fixtures/requested_reviewers.json b/source/platforms/_tests/fixtures/requested_reviewers.json new file mode 100644 index 000000000..0b6a45359 --- /dev/null +++ b/source/platforms/_tests/fixtures/requested_reviewers.json @@ -0,0 +1,21 @@ +[ + { + "login": "ArtsyOpenSource", + "id": 12397828, + "avatar_url": "https://avatars1.githubusercontent.com/u/12397828?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/ArtsyOpenSource", + "html_url": "https://github.com/ArtsyOpenSource", + "followers_url": "https://api.github.com/users/ArtsyOpenSource/followers", + "following_url": "https://api.github.com/users/ArtsyOpenSource/following{/other_user}", + "gists_url": "https://api.github.com/users/ArtsyOpenSource/gists{/gist_id}", + "starred_url": "https://api.github.com/users/ArtsyOpenSource/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/ArtsyOpenSource/subscriptions", + "organizations_url": "https://api.github.com/users/ArtsyOpenSource/orgs", + "repos_url": "https://api.github.com/users/ArtsyOpenSource/repos", + "events_url": "https://api.github.com/users/ArtsyOpenSource/events{/privacy}", + "received_events_url": "https://api.github.com/users/ArtsyOpenSource/received_events", + "type": "User", + "site_admin": false + } +] diff --git a/source/platforms/_tests/fixtures/reviews.json b/source/platforms/_tests/fixtures/reviews.json new file mode 100644 index 000000000..bc2d64a7f --- /dev/null +++ b/source/platforms/_tests/fixtures/reviews.json @@ -0,0 +1,146 @@ +[ + { + "id": 2332973, + "user": { + "login": "orta", + "id": 49038, + "avatar_url": "https://avatars1.githubusercontent.com/u/49038?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/orta", + "html_url": "https://github.com/orta", + "followers_url": "https://api.github.com/users/orta/followers", + "following_url": "https://api.github.com/users/orta/following{/other_user}", + "gists_url": "https://api.github.com/users/orta/gists{/gist_id}", + "starred_url": "https://api.github.com/users/orta/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/orta/subscriptions", + "organizations_url": "https://api.github.com/users/orta/orgs", + "repos_url": "https://api.github.com/users/orta/repos", + "events_url": "https://api.github.com/users/orta/events{/privacy}", + "received_events_url": "https://api.github.com/users/orta/received_events", + "type": "User", + "site_admin": false + }, + "body": "Generally speaking, there's a _lot_ of similar shaped code here that seems to mainly only be different to the artist a tiny amount\n", + "state": "COMMENTED", + "html_url": "https://github.com/artsy/emission/pull/327#pullrequestreview-2332973", + "pull_request_url": "https://api.github.com/repos/artsy/emission/pulls/327", + "_links": { + "html": { + "href": "https://github.com/artsy/emission/pull/327#pullrequestreview-2332973" + }, + "pull_request": { + "href": "https://api.github.com/repos/artsy/emission/pulls/327" + } + }, + "submitted_at": "2016-09-30T14:14:11Z", + "commit_id": "76c122e47ee36170c86739bb6cc665b6114e308c" + }, + { + "id": 2343835, + "user": { + "login": "orta", + "id": 49038, + "avatar_url": "https://avatars1.githubusercontent.com/u/49038?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/orta", + "html_url": "https://github.com/orta", + "followers_url": "https://api.github.com/users/orta/followers", + "following_url": "https://api.github.com/users/orta/following{/other_user}", + "gists_url": "https://api.github.com/users/orta/gists{/gist_id}", + "starred_url": "https://api.github.com/users/orta/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/orta/subscriptions", + "organizations_url": "https://api.github.com/users/orta/orgs", + "repos_url": "https://api.github.com/users/orta/repos", + "events_url": "https://api.github.com/users/orta/events{/privacy}", + "received_events_url": "https://api.github.com/users/orta/received_events", + "type": "User", + "site_admin": false + }, + "body": "", + "state": "COMMENTED", + "html_url": "https://github.com/artsy/emission/pull/327#pullrequestreview-2343835", + "pull_request_url": "https://api.github.com/repos/artsy/emission/pulls/327", + "_links": { + "html": { + "href": "https://github.com/artsy/emission/pull/327#pullrequestreview-2343835" + }, + "pull_request": { + "href": "https://api.github.com/repos/artsy/emission/pulls/327" + } + }, + "submitted_at": "2016-09-30T15:08:12Z", + "commit_id": "466bdef69fdbcdceb3b35242370edc328605ae1e" + }, + { + "id": 2344085, + "user": { + "login": "orta", + "id": 49038, + "avatar_url": "https://avatars1.githubusercontent.com/u/49038?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/orta", + "html_url": "https://github.com/orta", + "followers_url": "https://api.github.com/users/orta/followers", + "following_url": "https://api.github.com/users/orta/following{/other_user}", + "gists_url": "https://api.github.com/users/orta/gists{/gist_id}", + "starred_url": "https://api.github.com/users/orta/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/orta/subscriptions", + "organizations_url": "https://api.github.com/users/orta/orgs", + "repos_url": "https://api.github.com/users/orta/repos", + "events_url": "https://api.github.com/users/orta/events{/privacy}", + "received_events_url": "https://api.github.com/users/orta/received_events", + "type": "User", + "site_admin": false + }, + "body": "", + "state": "COMMENTED", + "html_url": "https://github.com/artsy/emission/pull/327#pullrequestreview-2344085", + "pull_request_url": "https://api.github.com/repos/artsy/emission/pulls/327", + "_links": { + "html": { + "href": "https://github.com/artsy/emission/pull/327#pullrequestreview-2344085" + }, + "pull_request": { + "href": "https://api.github.com/repos/artsy/emission/pulls/327" + } + }, + "submitted_at": "2016-09-30T15:09:27Z", + "commit_id": "466bdef69fdbcdceb3b35242370edc328605ae1e" + }, + { + "id": 2344137, + "user": { + "login": "orta", + "id": 49038, + "avatar_url": "https://avatars1.githubusercontent.com/u/49038?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/orta", + "html_url": "https://github.com/orta", + "followers_url": "https://api.github.com/users/orta/followers", + "following_url": "https://api.github.com/users/orta/following{/other_user}", + "gists_url": "https://api.github.com/users/orta/gists{/gist_id}", + "starred_url": "https://api.github.com/users/orta/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/orta/subscriptions", + "organizations_url": "https://api.github.com/users/orta/orgs", + "repos_url": "https://api.github.com/users/orta/repos", + "events_url": "https://api.github.com/users/orta/events{/privacy}", + "received_events_url": "https://api.github.com/users/orta/received_events", + "type": "User", + "site_admin": false + }, + "body": "", + "state": "COMMENTED", + "html_url": "https://github.com/artsy/emission/pull/327#pullrequestreview-2344137", + "pull_request_url": "https://api.github.com/repos/artsy/emission/pulls/327", + "_links": { + "html": { + "href": "https://github.com/artsy/emission/pull/327#pullrequestreview-2344137" + }, + "pull_request": { + "href": "https://api.github.com/repos/artsy/emission/pulls/327" + } + }, + "submitted_at": "2016-09-30T15:09:47Z", + "commit_id": "466bdef69fdbcdceb3b35242370edc328605ae1e" + } +] diff --git a/source/runner/types.ts b/source/runner/types.ts index a4fa18527..001071df8 100644 --- a/source/runner/types.ts +++ b/source/runner/types.ts @@ -23,6 +23,19 @@ export interface EnvironmentConstructor { new (config: any): Environment } +export interface InternalModuleOptions { + isInternalModule: boolean, +} + +export interface JestRuntime { + requireModule( + from: Path, + moduleName?: string, + options?: InternalModuleOptions, + ): any + +} + export interface Environment extends EnvironmentConstructor { dispose(): void runScript(script: any): any diff --git a/yarn.lock b/yarn.lock index 444bc2929..2e8c17751 100644 --- a/yarn.lock +++ b/yarn.lock @@ -84,7 +84,7 @@ ansi-regex@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.0.0.tgz#c5061b6e0ef8a81775e50f5d66151bf6bf371107" -ansi-styles@^2.2.1: +ansi-styles@^2.1.0, ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" @@ -156,7 +156,7 @@ array-find-index@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1" -array-uniq@^1.0.2: +array-uniq@^1.0.0, array-uniq@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" @@ -214,21 +214,26 @@ aws4@^1.2.1: version "1.5.0" resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.5.0.tgz#0a29ffb79c31c9e712eeb087e8e7a64b4a56d755" -babel-cli@^6.16.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-cli/-/babel-cli-6.18.0.tgz#92117f341add9dead90f6fa7d0a97c0cc08ec186" +babel-cli@6.16: + version "6.16.0" + resolved "https://registry.yarnpkg.com/babel-cli/-/babel-cli-6.16.0.tgz#4e0d1cf40442ef78330f7fef88eb3a0a1b16bd37" dependencies: - babel-core "^6.18.0" + babel-core "^6.16.0" babel-polyfill "^6.16.0" - babel-register "^6.18.0" + babel-register "^6.16.0" babel-runtime "^6.9.0" + bin-version-check "^2.1.0" + chalk "1.1.1" commander "^2.8.1" convert-source-map "^1.1.0" - fs-readdir-recursive "^1.0.0" + fs-readdir-recursive "^0.1.0" glob "^5.0.5" lodash "^4.2.0" + log-symbols "^1.0.2" output-file-sync "^1.1.0" + path-exists "^1.0.0" path-is-absolute "^1.0.0" + request "^2.65.0" slash "^1.0.0" source-map "^0.5.0" v8flags "^2.0.10" @@ -243,7 +248,15 @@ babel-code-frame@^6.20.0: esutils "^2.0.2" js-tokens "^2.0.0" -babel-core@^6.0.0, babel-core@^6.18.0: +babel-code-frame@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.22.0.tgz#027620bee567a88c32561574e7fd0801d33118e4" + dependencies: + chalk "^1.1.0" + esutils "^2.0.2" + js-tokens "^3.0.0" + +babel-core@^6.0.0, babel-core@^6.16.0, babel-core@^6.18.0: version "6.21.0" resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.21.0.tgz#75525480c21c803f826ef3867d22c19f080a3724" dependencies: @@ -279,99 +292,99 @@ babel-generator@^6.18.0, babel-generator@^6.21.0: lodash "^4.2.0" source-map "^0.5.0" -babel-helper-builder-binary-assignment-operator-visitor@^6.8.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.18.0.tgz#8ae814989f7a53682152e3401a04fabd0bb333a6" +babel-helper-builder-binary-assignment-operator-visitor@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.22.0.tgz#29df56be144d81bdeac08262bfa41d2c5e91cdcd" dependencies: - babel-helper-explode-assignable-expression "^6.18.0" - babel-runtime "^6.0.0" - babel-types "^6.18.0" + babel-helper-explode-assignable-expression "^6.22.0" + babel-runtime "^6.22.0" + babel-types "^6.22.0" -babel-helper-call-delegate@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.18.0.tgz#05b14aafa430884b034097ef29e9f067ea4133bd" +babel-helper-call-delegate@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.22.0.tgz#119921b56120f17e9dae3f74b4f5cc7bcc1b37ef" dependencies: - babel-helper-hoist-variables "^6.18.0" - babel-runtime "^6.0.0" - babel-traverse "^6.18.0" - babel-types "^6.18.0" + babel-helper-hoist-variables "^6.22.0" + babel-runtime "^6.22.0" + babel-traverse "^6.22.0" + babel-types "^6.22.0" -babel-helper-define-map@^6.18.0, babel-helper-define-map@^6.8.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-6.18.0.tgz#8d6c85dc7fbb4c19be3de40474d18e97c3676ec2" +babel-helper-define-map@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-6.23.0.tgz#1444f960c9691d69a2ced6a205315f8fd00804e7" dependencies: - babel-helper-function-name "^6.18.0" - babel-runtime "^6.9.0" - babel-types "^6.18.0" + babel-helper-function-name "^6.23.0" + babel-runtime "^6.22.0" + babel-types "^6.23.0" lodash "^4.2.0" -babel-helper-explode-assignable-expression@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.18.0.tgz#14b8e8c2d03ad735d4b20f1840b24cd1f65239fe" +babel-helper-explode-assignable-expression@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.22.0.tgz#c97bf76eed3e0bae4048121f2b9dae1a4e7d0478" dependencies: - babel-runtime "^6.0.0" - babel-traverse "^6.18.0" - babel-types "^6.18.0" + babel-runtime "^6.22.0" + babel-traverse "^6.22.0" + babel-types "^6.22.0" -babel-helper-function-name@^6.18.0, babel-helper-function-name@^6.8.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.18.0.tgz#68ec71aeba1f3e28b2a6f0730190b754a9bf30e6" +babel-helper-function-name@^6.22.0, babel-helper-function-name@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.23.0.tgz#25742d67175c8903dbe4b6cb9d9e1fcb8dcf23a6" dependencies: - babel-helper-get-function-arity "^6.18.0" - babel-runtime "^6.0.0" - babel-template "^6.8.0" - babel-traverse "^6.18.0" - babel-types "^6.18.0" + babel-helper-get-function-arity "^6.22.0" + babel-runtime "^6.22.0" + babel-template "^6.23.0" + babel-traverse "^6.23.0" + babel-types "^6.23.0" -babel-helper-get-function-arity@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.18.0.tgz#a5b19695fd3f9cdfc328398b47dafcd7094f9f24" +babel-helper-get-function-arity@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.22.0.tgz#0beb464ad69dc7347410ac6ade9f03a50634f5ce" dependencies: - babel-runtime "^6.0.0" - babel-types "^6.18.0" + babel-runtime "^6.22.0" + babel-types "^6.22.0" -babel-helper-hoist-variables@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.18.0.tgz#a835b5ab8b46d6de9babefae4d98ea41e866b82a" +babel-helper-hoist-variables@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.22.0.tgz#3eacbf731d80705845dd2e9718f600cfb9b4ba72" dependencies: - babel-runtime "^6.0.0" - babel-types "^6.18.0" + babel-runtime "^6.22.0" + babel-types "^6.22.0" -babel-helper-optimise-call-expression@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.18.0.tgz#9261d0299ee1a4f08a6dd28b7b7c777348fd8f0f" +babel-helper-optimise-call-expression@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.23.0.tgz#f3ee7eed355b4282138b33d02b78369e470622f5" dependencies: - babel-runtime "^6.0.0" - babel-types "^6.18.0" + babel-runtime "^6.22.0" + babel-types "^6.23.0" -babel-helper-regex@^6.8.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-helper-regex/-/babel-helper-regex-6.18.0.tgz#ae0ebfd77de86cb2f1af258e2cc20b5fe893ecc6" +babel-helper-regex@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-helper-regex/-/babel-helper-regex-6.22.0.tgz#79f532be1647b1f0ee3474b5f5c3da58001d247d" dependencies: - babel-runtime "^6.9.0" - babel-types "^6.18.0" + babel-runtime "^6.22.0" + babel-types "^6.22.0" lodash "^4.2.0" -babel-helper-remap-async-to-generator@^6.16.0, babel-helper-remap-async-to-generator@^6.16.2: - version "6.20.3" - resolved "https://registry.yarnpkg.com/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.20.3.tgz#9dd3b396f13e35ef63e538098500adc24c63c4e7" +babel-helper-remap-async-to-generator@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.22.0.tgz#2186ae73278ed03b8b15ced089609da981053383" dependencies: - babel-helper-function-name "^6.18.0" - babel-runtime "^6.20.0" - babel-template "^6.16.0" - babel-traverse "^6.20.0" - babel-types "^6.20.0" + babel-helper-function-name "^6.22.0" + babel-runtime "^6.22.0" + babel-template "^6.22.0" + babel-traverse "^6.22.0" + babel-types "^6.22.0" -babel-helper-replace-supers@^6.18.0, babel-helper-replace-supers@^6.8.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.18.0.tgz#28ec69877be4144dbd64f4cc3a337e89f29a924e" +babel-helper-replace-supers@^6.22.0, babel-helper-replace-supers@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.23.0.tgz#eeaf8ad9b58ec4337ca94223bacdca1f8d9b4bfd" dependencies: - babel-helper-optimise-call-expression "^6.18.0" - babel-messages "^6.8.0" - babel-runtime "^6.0.0" - babel-template "^6.16.0" - babel-traverse "^6.18.0" - babel-types "^6.18.0" + babel-helper-optimise-call-expression "^6.23.0" + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-template "^6.23.0" + babel-traverse "^6.23.0" + babel-types "^6.23.0" babel-helpers@^6.16.0: version "6.16.0" @@ -396,17 +409,23 @@ babel-jest@^19.0.0: babel-plugin-istanbul "^4.0.0" babel-preset-jest "^19.0.0" +babel-messages@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" + dependencies: + babel-runtime "^6.22.0" + babel-messages@^6.8.0: version "6.8.0" resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.8.0.tgz#bf504736ca967e6d65ef0adb5a2a5f947c8e0eb9" dependencies: babel-runtime "^6.0.0" -babel-plugin-check-es2015-constants@^6.3.13: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.8.0.tgz#dbf024c32ed37bfda8dee1e76da02386a8d26fe7" +babel-plugin-check-es2015-constants@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz#35157b101426fd2ffd3da3f75c7d1e91835bbf8a" dependencies: - babel-runtime "^6.0.0" + babel-runtime "^6.22.0" babel-plugin-istanbul@^3.0.0: version "3.1.2" @@ -453,229 +472,228 @@ babel-plugin-syntax-object-rest-spread@^6.8.0: version "6.13.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5" -babel-plugin-syntax-trailing-function-commas@^6.3.13: - version "6.20.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.20.0.tgz#442835e19179f45b87e92d477d70b9f1f18b5c4f" +babel-plugin-syntax-trailing-function-commas@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz#ba0360937f8d06e40180a43fe0d5616fff532cf3" -babel-plugin-transform-async-generator-functions@^6.17.0: - version "6.17.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-generator-functions/-/babel-plugin-transform-async-generator-functions-6.17.0.tgz#d0b5a2b2f0940f2b245fa20a00519ed7bc6cae54" +babel-plugin-transform-async-generator-functions@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-generator-functions/-/babel-plugin-transform-async-generator-functions-6.22.0.tgz#a720a98153a7596f204099cd5409f4b3c05bab46" dependencies: - babel-helper-remap-async-to-generator "^6.16.2" + babel-helper-remap-async-to-generator "^6.22.0" babel-plugin-syntax-async-generators "^6.5.0" - babel-runtime "^6.0.0" + babel-runtime "^6.22.0" -babel-plugin-transform-async-to-generator@^6.16.0: - version "6.16.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.16.0.tgz#19ec36cb1486b59f9f468adfa42ce13908ca2999" +babel-plugin-transform-async-to-generator@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.22.0.tgz#194b6938ec195ad36efc4c33a971acf00d8cd35e" dependencies: - babel-helper-remap-async-to-generator "^6.16.0" + babel-helper-remap-async-to-generator "^6.22.0" babel-plugin-syntax-async-functions "^6.8.0" - babel-runtime "^6.0.0" + babel-runtime "^6.22.0" -babel-plugin-transform-es2015-arrow-functions@^6.3.13: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.8.0.tgz#5b63afc3181bdc9a8c4d481b5a4f3f7d7fef3d9d" +babel-plugin-transform-es2015-arrow-functions@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221" dependencies: - babel-runtime "^6.0.0" + babel-runtime "^6.22.0" -babel-plugin-transform-es2015-block-scoped-functions@^6.3.13: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.8.0.tgz#ed95d629c4b5a71ae29682b998f70d9833eb366d" +babel-plugin-transform-es2015-block-scoped-functions@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz#bbc51b49f964d70cb8d8e0b94e820246ce3a6141" dependencies: - babel-runtime "^6.0.0" + babel-runtime "^6.22.0" -babel-plugin-transform-es2015-block-scoping@^6.18.0: - version "6.21.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.21.0.tgz#e840687f922e70fb2c42bb13501838c174a115ed" +babel-plugin-transform-es2015-block-scoping@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.23.0.tgz#e48895cf0b375be148cd7c8879b422707a053b51" dependencies: - babel-runtime "^6.20.0" - babel-template "^6.15.0" - babel-traverse "^6.21.0" - babel-types "^6.21.0" + babel-runtime "^6.22.0" + babel-template "^6.23.0" + babel-traverse "^6.23.0" + babel-types "^6.23.0" lodash "^4.2.0" -babel-plugin-transform-es2015-classes@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.18.0.tgz#ffe7a17321bf83e494dcda0ae3fc72df48ffd1d9" +babel-plugin-transform-es2015-classes@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.23.0.tgz#49b53f326202a2fd1b3bbaa5e2edd8a4f78643c1" dependencies: - babel-helper-define-map "^6.18.0" - babel-helper-function-name "^6.18.0" - babel-helper-optimise-call-expression "^6.18.0" - babel-helper-replace-supers "^6.18.0" - babel-messages "^6.8.0" - babel-runtime "^6.9.0" - babel-template "^6.14.0" - babel-traverse "^6.18.0" - babel-types "^6.18.0" + babel-helper-define-map "^6.23.0" + babel-helper-function-name "^6.23.0" + babel-helper-optimise-call-expression "^6.23.0" + babel-helper-replace-supers "^6.23.0" + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-template "^6.23.0" + babel-traverse "^6.23.0" + babel-types "^6.23.0" -babel-plugin-transform-es2015-computed-properties@^6.3.13: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.8.0.tgz#f51010fd61b3bd7b6b60a5fdfd307bb7a5279870" +babel-plugin-transform-es2015-computed-properties@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.22.0.tgz#7c383e9629bba4820c11b0425bdd6290f7f057e7" dependencies: - babel-helper-define-map "^6.8.0" - babel-runtime "^6.0.0" - babel-template "^6.8.0" + babel-runtime "^6.22.0" + babel-template "^6.22.0" -babel-plugin-transform-es2015-destructuring@^6.18.0: - version "6.19.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.19.0.tgz#ff1d911c4b3f4cab621bd66702a869acd1900533" +babel-plugin-transform-es2015-destructuring@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d" dependencies: - babel-runtime "^6.9.0" + babel-runtime "^6.22.0" -babel-plugin-transform-es2015-duplicate-keys@^6.6.0: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.8.0.tgz#fd8f7f7171fc108cc1c70c3164b9f15a81c25f7d" +babel-plugin-transform-es2015-duplicate-keys@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.22.0.tgz#672397031c21610d72dd2bbb0ba9fb6277e1c36b" dependencies: - babel-runtime "^6.0.0" - babel-types "^6.8.0" + babel-runtime "^6.22.0" + babel-types "^6.22.0" -babel-plugin-transform-es2015-for-of@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.18.0.tgz#4c517504db64bf8cfc119a6b8f177211f2028a70" +babel-plugin-transform-es2015-for-of@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691" dependencies: - babel-runtime "^6.0.0" + babel-runtime "^6.22.0" -babel-plugin-transform-es2015-function-name@^6.9.0: - version "6.9.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.9.0.tgz#8c135b17dbd064e5bba56ec511baaee2fca82719" +babel-plugin-transform-es2015-function-name@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.22.0.tgz#f5fcc8b09093f9a23c76ac3d9e392c3ec4b77104" dependencies: - babel-helper-function-name "^6.8.0" - babel-runtime "^6.9.0" - babel-types "^6.9.0" + babel-helper-function-name "^6.22.0" + babel-runtime "^6.22.0" + babel-types "^6.22.0" -babel-plugin-transform-es2015-literals@^6.3.13: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.8.0.tgz#50aa2e5c7958fc2ab25d74ec117e0cc98f046468" +babel-plugin-transform-es2015-literals@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz#4f54a02d6cd66cf915280019a31d31925377ca2e" dependencies: - babel-runtime "^6.0.0" + babel-runtime "^6.22.0" -babel-plugin-transform-es2015-modules-amd@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.18.0.tgz#49a054cbb762bdf9ae2d8a807076cfade6141e40" +babel-plugin-transform-es2015-modules-amd@^6.24.0: + version "6.24.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.0.tgz#a1911fb9b7ec7e05a43a63c5995007557bcf6a2e" dependencies: - babel-plugin-transform-es2015-modules-commonjs "^6.18.0" - babel-runtime "^6.0.0" - babel-template "^6.8.0" + babel-plugin-transform-es2015-modules-commonjs "^6.24.0" + babel-runtime "^6.22.0" + babel-template "^6.22.0" -babel-plugin-transform-es2015-modules-commonjs@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.18.0.tgz#c15ae5bb11b32a0abdcc98a5837baa4ee8d67bcc" +babel-plugin-transform-es2015-modules-commonjs@^6.24.0: + version "6.24.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.24.0.tgz#e921aefb72c2cc26cb03d107626156413222134f" dependencies: - babel-plugin-transform-strict-mode "^6.18.0" - babel-runtime "^6.0.0" - babel-template "^6.16.0" - babel-types "^6.18.0" + babel-plugin-transform-strict-mode "^6.22.0" + babel-runtime "^6.22.0" + babel-template "^6.23.0" + babel-types "^6.23.0" -babel-plugin-transform-es2015-modules-systemjs@^6.18.0: - version "6.19.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.19.0.tgz#50438136eba74527efa00a5b0fefaf1dc4071da6" +babel-plugin-transform-es2015-modules-systemjs@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.23.0.tgz#ae3469227ffac39b0310d90fec73bfdc4f6317b0" dependencies: - babel-helper-hoist-variables "^6.18.0" - babel-runtime "^6.11.6" - babel-template "^6.14.0" + babel-helper-hoist-variables "^6.22.0" + babel-runtime "^6.22.0" + babel-template "^6.23.0" -babel-plugin-transform-es2015-modules-umd@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.18.0.tgz#23351770ece5c1f8e83ed67cb1d7992884491e50" +babel-plugin-transform-es2015-modules-umd@^6.24.0: + version "6.24.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.0.tgz#fd5fa63521cae8d273927c3958afd7c067733450" dependencies: - babel-plugin-transform-es2015-modules-amd "^6.18.0" - babel-runtime "^6.0.0" - babel-template "^6.8.0" + babel-plugin-transform-es2015-modules-amd "^6.24.0" + babel-runtime "^6.22.0" + babel-template "^6.23.0" -babel-plugin-transform-es2015-object-super@^6.3.13: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.8.0.tgz#1b858740a5a4400887c23dcff6f4d56eea4a24c5" +babel-plugin-transform-es2015-object-super@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.22.0.tgz#daa60e114a042ea769dd53fe528fc82311eb98fc" dependencies: - babel-helper-replace-supers "^6.8.0" - babel-runtime "^6.0.0" + babel-helper-replace-supers "^6.22.0" + babel-runtime "^6.22.0" -babel-plugin-transform-es2015-parameters@^6.18.0: - version "6.21.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.21.0.tgz#46a655e6864ef984091448cdf024d87b60b2a7d8" +babel-plugin-transform-es2015-parameters@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.23.0.tgz#3a2aabb70c8af945d5ce386f1a4250625a83ae3b" dependencies: - babel-helper-call-delegate "^6.18.0" - babel-helper-get-function-arity "^6.18.0" - babel-runtime "^6.9.0" - babel-template "^6.16.0" - babel-traverse "^6.21.0" - babel-types "^6.21.0" + babel-helper-call-delegate "^6.22.0" + babel-helper-get-function-arity "^6.22.0" + babel-runtime "^6.22.0" + babel-template "^6.23.0" + babel-traverse "^6.23.0" + babel-types "^6.23.0" -babel-plugin-transform-es2015-shorthand-properties@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.18.0.tgz#e2ede3b7df47bf980151926534d1dd0cbea58f43" +babel-plugin-transform-es2015-shorthand-properties@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.22.0.tgz#8ba776e0affaa60bff21e921403b8a652a2ff723" dependencies: - babel-runtime "^6.0.0" - babel-types "^6.18.0" + babel-runtime "^6.22.0" + babel-types "^6.22.0" -babel-plugin-transform-es2015-spread@^6.3.13: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.8.0.tgz#0217f737e3b821fa5a669f187c6ed59205f05e9c" +babel-plugin-transform-es2015-spread@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz#d6d68a99f89aedc4536c81a542e8dd9f1746f8d1" dependencies: - babel-runtime "^6.0.0" + babel-runtime "^6.22.0" -babel-plugin-transform-es2015-sticky-regex@^6.3.13: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.8.0.tgz#e73d300a440a35d5c64f5c2a344dc236e3df47be" +babel-plugin-transform-es2015-sticky-regex@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.22.0.tgz#ab316829e866ee3f4b9eb96939757d19a5bc4593" dependencies: - babel-helper-regex "^6.8.0" - babel-runtime "^6.0.0" - babel-types "^6.8.0" + babel-helper-regex "^6.22.0" + babel-runtime "^6.22.0" + babel-types "^6.22.0" -babel-plugin-transform-es2015-template-literals@^6.6.0: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.8.0.tgz#86eb876d0a2c635da4ec048b4f7de9dfc897e66b" +babel-plugin-transform-es2015-template-literals@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz#a84b3450f7e9f8f1f6839d6d687da84bb1236d8d" dependencies: - babel-runtime "^6.0.0" + babel-runtime "^6.22.0" -babel-plugin-transform-es2015-typeof-symbol@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.18.0.tgz#0b14c48629c90ff47a0650077f6aa699bee35798" +babel-plugin-transform-es2015-typeof-symbol@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz#dec09f1cddff94b52ac73d505c84df59dcceb372" dependencies: - babel-runtime "^6.0.0" + babel-runtime "^6.22.0" -babel-plugin-transform-es2015-unicode-regex@^6.3.13: - version "6.11.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.11.0.tgz#6298ceabaad88d50a3f4f392d8de997260f6ef2c" +babel-plugin-transform-es2015-unicode-regex@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.22.0.tgz#8d9cc27e7ee1decfe65454fb986452a04a613d20" dependencies: - babel-helper-regex "^6.8.0" - babel-runtime "^6.0.0" + babel-helper-regex "^6.22.0" + babel-runtime "^6.22.0" regexpu-core "^2.0.0" -babel-plugin-transform-exponentiation-operator@^6.3.13: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.8.0.tgz#db25742e9339eade676ca9acec46f955599a68a4" +babel-plugin-transform-exponentiation-operator@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.22.0.tgz#d57c8335281918e54ef053118ce6eb108468084d" dependencies: - babel-helper-builder-binary-assignment-operator-visitor "^6.8.0" + babel-helper-builder-binary-assignment-operator-visitor "^6.22.0" babel-plugin-syntax-exponentiation-operator "^6.8.0" - babel-runtime "^6.0.0" + babel-runtime "^6.22.0" -babel-plugin-transform-flow-strip-types@^6.8.0: - version "6.21.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-flow-strip-types/-/babel-plugin-transform-flow-strip-types-6.21.0.tgz#2eea3f8b5bb234339b47283feac155cfb237b948" +babel-plugin-transform-flow-strip-types@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-flow-strip-types/-/babel-plugin-transform-flow-strip-types-6.22.0.tgz#84cb672935d43714fdc32bce84568d87441cf7cf" dependencies: babel-plugin-syntax-flow "^6.18.0" - babel-runtime "^6.0.0" + babel-runtime "^6.22.0" -babel-plugin-transform-object-rest-spread@^6.16.0: - version "6.20.2" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.20.2.tgz#e816c55bba77b14c16365d87e2ae48c8fd18fc2e" +babel-plugin-transform-object-rest-spread@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.23.0.tgz#875d6bc9be761c58a2ae3feee5dc4895d8c7f921" dependencies: babel-plugin-syntax-object-rest-spread "^6.8.0" - babel-runtime "^6.20.0" + babel-runtime "^6.22.0" -babel-plugin-transform-regenerator@^6.16.0, babel-plugin-transform-regenerator@^6.16.1: - version "6.21.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.21.0.tgz#75d0c7e7f84f379358f508451c68a2c5fa5a9703" +babel-plugin-transform-regenerator@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.22.0.tgz#65740593a319c44522157538d690b84094617ea6" dependencies: regenerator-transform "0.9.8" -babel-plugin-transform-strict-mode@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.18.0.tgz#df7cf2991fe046f44163dcd110d5ca43bc652b9d" +babel-plugin-transform-strict-mode@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.22.0.tgz#e008df01340fdc87e959da65991b7e05970c8c7c" dependencies: - babel-runtime "^6.0.0" - babel-types "^6.18.0" + babel-runtime "^6.22.0" + babel-types "^6.22.0" babel-polyfill@^6.16.0, babel-polyfill@^6.20.0: version "6.20.0" @@ -685,34 +703,34 @@ babel-polyfill@^6.16.0, babel-polyfill@^6.20.0: core-js "^2.4.0" regenerator-runtime "^0.10.0" -babel-preset-es2015@^6.16.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-6.18.0.tgz#b8c70df84ec948c43dcf2bf770e988eb7da88312" - dependencies: - babel-plugin-check-es2015-constants "^6.3.13" - babel-plugin-transform-es2015-arrow-functions "^6.3.13" - babel-plugin-transform-es2015-block-scoped-functions "^6.3.13" - babel-plugin-transform-es2015-block-scoping "^6.18.0" - babel-plugin-transform-es2015-classes "^6.18.0" - babel-plugin-transform-es2015-computed-properties "^6.3.13" - babel-plugin-transform-es2015-destructuring "^6.18.0" - babel-plugin-transform-es2015-duplicate-keys "^6.6.0" - babel-plugin-transform-es2015-for-of "^6.18.0" - babel-plugin-transform-es2015-function-name "^6.9.0" - babel-plugin-transform-es2015-literals "^6.3.13" - babel-plugin-transform-es2015-modules-amd "^6.18.0" - babel-plugin-transform-es2015-modules-commonjs "^6.18.0" - babel-plugin-transform-es2015-modules-systemjs "^6.18.0" - babel-plugin-transform-es2015-modules-umd "^6.18.0" - babel-plugin-transform-es2015-object-super "^6.3.13" - babel-plugin-transform-es2015-parameters "^6.18.0" - babel-plugin-transform-es2015-shorthand-properties "^6.18.0" - babel-plugin-transform-es2015-spread "^6.3.13" - babel-plugin-transform-es2015-sticky-regex "^6.3.13" - babel-plugin-transform-es2015-template-literals "^6.6.0" - babel-plugin-transform-es2015-typeof-symbol "^6.18.0" - babel-plugin-transform-es2015-unicode-regex "^6.3.13" - babel-plugin-transform-regenerator "^6.16.0" +babel-preset-es2015@^6.24.0: + version "6.24.0" + resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-6.24.0.tgz#c162d68b1932696e036cd3110dc1ccd303d2673a" + dependencies: + babel-plugin-check-es2015-constants "^6.22.0" + babel-plugin-transform-es2015-arrow-functions "^6.22.0" + babel-plugin-transform-es2015-block-scoped-functions "^6.22.0" + babel-plugin-transform-es2015-block-scoping "^6.22.0" + babel-plugin-transform-es2015-classes "^6.22.0" + babel-plugin-transform-es2015-computed-properties "^6.22.0" + babel-plugin-transform-es2015-destructuring "^6.22.0" + babel-plugin-transform-es2015-duplicate-keys "^6.22.0" + babel-plugin-transform-es2015-for-of "^6.22.0" + babel-plugin-transform-es2015-function-name "^6.22.0" + babel-plugin-transform-es2015-literals "^6.22.0" + babel-plugin-transform-es2015-modules-amd "^6.24.0" + babel-plugin-transform-es2015-modules-commonjs "^6.24.0" + babel-plugin-transform-es2015-modules-systemjs "^6.22.0" + babel-plugin-transform-es2015-modules-umd "^6.24.0" + babel-plugin-transform-es2015-object-super "^6.22.0" + babel-plugin-transform-es2015-parameters "^6.22.0" + babel-plugin-transform-es2015-shorthand-properties "^6.22.0" + babel-plugin-transform-es2015-spread "^6.22.0" + babel-plugin-transform-es2015-sticky-regex "^6.22.0" + babel-plugin-transform-es2015-template-literals "^6.22.0" + babel-plugin-transform-es2015-typeof-symbol "^6.22.0" + babel-plugin-transform-es2015-unicode-regex "^6.22.0" + babel-plugin-transform-regenerator "^6.22.0" babel-preset-jest@^18.0.0: version "18.0.0" @@ -726,17 +744,17 @@ babel-preset-jest@^19.0.0: dependencies: babel-plugin-jest-hoist "^19.0.0" -babel-preset-stage-3@^6.17.0: - version "6.17.0" - resolved "https://registry.yarnpkg.com/babel-preset-stage-3/-/babel-preset-stage-3-6.17.0.tgz#b6638e46db6e91e3f889013d8ce143917c685e39" +babel-preset-stage-3@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-preset-stage-3/-/babel-preset-stage-3-6.22.0.tgz#a4e92bbace7456fafdf651d7a7657ee0bbca9c2e" dependencies: - babel-plugin-syntax-trailing-function-commas "^6.3.13" - babel-plugin-transform-async-generator-functions "^6.17.0" - babel-plugin-transform-async-to-generator "^6.16.0" - babel-plugin-transform-exponentiation-operator "^6.3.13" - babel-plugin-transform-object-rest-spread "^6.16.0" + babel-plugin-syntax-trailing-function-commas "^6.22.0" + babel-plugin-transform-async-generator-functions "^6.22.0" + babel-plugin-transform-async-to-generator "^6.22.0" + babel-plugin-transform-exponentiation-operator "^6.22.0" + babel-plugin-transform-object-rest-spread "^6.22.0" -babel-register@^6.18.0: +babel-register@^6.16.0, babel-register@^6.18.0: version "6.18.0" resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.18.0.tgz#892e2e03865078dd90ad2c715111ec4449b32a68" dependencies: @@ -755,7 +773,14 @@ babel-runtime@^6.0.0, babel-runtime@^6.11.6, babel-runtime@^6.18.0, babel-runtim core-js "^2.4.0" regenerator-runtime "^0.10.0" -babel-template@^6.14.0, babel-template@^6.15.0, babel-template@^6.16.0, babel-template@^6.8.0: +babel-runtime@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.23.0.tgz#0a9489f144de70efb3ce4300accdb329e2fc543b" + dependencies: + core-js "^2.4.0" + regenerator-runtime "^0.10.0" + +babel-template@^6.16.0: version "6.16.0" resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.16.0.tgz#e149dd1a9f03a35f817ddbc4d0481988e7ebc8ca" dependencies: @@ -765,7 +790,17 @@ babel-template@^6.14.0, babel-template@^6.15.0, babel-template@^6.16.0, babel-te babylon "^6.11.0" lodash "^4.2.0" -babel-traverse@^6.16.0, babel-traverse@^6.18.0, babel-traverse@^6.20.0, babel-traverse@^6.21.0: +babel-template@^6.22.0, babel-template@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.23.0.tgz#04d4f270adbb3aa704a8143ae26faa529238e638" + dependencies: + babel-runtime "^6.22.0" + babel-traverse "^6.23.0" + babel-types "^6.23.0" + babylon "^6.11.0" + lodash "^4.2.0" + +babel-traverse@^6.16.0, babel-traverse@^6.18.0, babel-traverse@^6.21.0: version "6.21.0" resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.21.0.tgz#69c6365804f1a4f69eb1213f85b00a818b8c21ad" dependencies: @@ -779,7 +814,21 @@ babel-traverse@^6.16.0, babel-traverse@^6.18.0, babel-traverse@^6.20.0, babel-tr invariant "^2.2.0" lodash "^4.2.0" -babel-types@^6.16.0, babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.20.0, babel-types@^6.21.0, babel-types@^6.8.0, babel-types@^6.9.0: +babel-traverse@^6.22.0, babel-traverse@^6.23.0: + version "6.23.1" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.23.1.tgz#d3cb59010ecd06a97d81310065f966b699e14f48" + dependencies: + babel-code-frame "^6.22.0" + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-types "^6.23.0" + babylon "^6.15.0" + debug "^2.2.0" + globals "^9.0.0" + invariant "^2.2.0" + lodash "^4.2.0" + +babel-types@^6.16.0, babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.21.0: version "6.21.0" resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.21.0.tgz#314b92168891ef6d3806b7f7a917fdf87c11a4b2" dependencies: @@ -788,10 +837,23 @@ babel-types@^6.16.0, babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.20 lodash "^4.2.0" to-fast-properties "^1.0.1" +babel-types@^6.22.0, babel-types@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.23.0.tgz#bb17179d7538bad38cd0c9e115d340f77e7e9acf" + dependencies: + babel-runtime "^6.22.0" + esutils "^2.0.2" + lodash "^4.2.0" + to-fast-properties "^1.0.1" + babylon@^6.11.0, babylon@^6.13.0: version "6.14.1" resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.14.1.tgz#956275fab72753ad9b3435d7afe58f8bf0a29815" +babylon@^6.15.0: + version "6.16.1" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.16.1.tgz#30c5a22f481978a9e7f8cdfdf496b11d94b404d3" + babylon@~6.8.1: version "6.8.4" resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.8.4.tgz#097306b8dabae95159225cf29b3ea55912053180" @@ -812,6 +874,21 @@ beeper@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/beeper/-/beeper-1.1.1.tgz#e6d5ea8c5dad001304a70b22638447f69cb2f809" +bin-version-check@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/bin-version-check/-/bin-version-check-2.1.0.tgz#e4e5df290b9069f7d111324031efc13fdd11a5b0" + dependencies: + bin-version "^1.0.0" + minimist "^1.1.0" + semver "^4.0.3" + semver-truncate "^1.0.0" + +bin-version@^1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/bin-version/-/bin-version-1.0.4.tgz#9eb498ee6fd76f7ab9a7c160436f89579435d78e" + dependencies: + find-versions "^1.0.0" + binary-extensions@^1.0.0: version "1.8.0" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.8.0.tgz#48ec8d16df4377eae5fa5884682480af4d95c774" @@ -923,6 +1000,16 @@ center-align@^0.1.1: align-text "^0.1.3" lazy-cache "^1.0.3" +chalk@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.1.tgz#509afb67066e7499f7eb3535c77445772ae2d019" + dependencies: + ansi-styles "^2.1.0" + escape-string-regexp "^1.0.2" + has-ansi "^2.0.0" + strip-ansi "^3.0.0" + supports-color "^2.0.0" + chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" @@ -1480,6 +1567,15 @@ find-up@^2.1.0: dependencies: locate-path "^2.0.0" +find-versions@^1.0.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/find-versions/-/find-versions-1.2.1.tgz#cbde9f12e38575a0af1be1b9a2c5d5fd8f186b62" + dependencies: + array-uniq "^1.0.0" + get-stdin "^4.0.1" + meow "^3.5.0" + semver-regex "^1.0.0" + find@0.2.6: version "0.2.6" resolved "https://registry.yarnpkg.com/find/-/find-0.2.6.tgz#0d218b5d48c3424193f64cea59d389f8daa71d01" @@ -1523,9 +1619,9 @@ fs-extra@~0.6.4: ncp "~0.4.2" rimraf "~2.2.0" -fs-readdir-recursive@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs-readdir-recursive/-/fs-readdir-recursive-1.0.0.tgz#8cd1745c8b4f8a29c8caec392476921ba195f560" +fs-readdir-recursive@^0.1.0: + version "0.1.2" + resolved "https://registry.yarnpkg.com/fs-readdir-recursive/-/fs-readdir-recursive-0.1.2.tgz#315b4fb8c1ca5b8c47defef319d073dad3568059" fs.realpath@^1.0.0: version "1.0.0" @@ -2451,6 +2547,10 @@ js-tokens@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-2.0.0.tgz#79903f5563ee778cc1162e6dcf1a0027c97f9cb5" +js-tokens@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.1.tgz#08e9f132484a2c45a30907e9dc4d5567b7f114d7" + js-yaml@3.x, js-yaml@^3.4.3, js-yaml@^3.7.0: version "3.7.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.7.0.tgz#5c967ddd837a9bfdca5f2de84253abe8a1c03b80" @@ -2878,7 +2978,7 @@ memory-fs@^0.4.0: errno "^0.1.3" readable-stream "^2.0.1" -meow@^3.3.0: +meow@^3.3.0, meow@^3.5.0: version "3.7.0" resolved "https://registry.yarnpkg.com/meow/-/meow-3.7.0.tgz#72cb668b425228290abbfa856892587308a801fb" dependencies: @@ -3245,6 +3345,10 @@ parse5@^1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/parse5/-/parse5-1.5.1.tgz#9b7f3b0de32be78dc2401b17573ccaf0f6f59d94" +path-exists@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-1.0.0.tgz#d5a8998eb71ef37a74c34eb0d9eba6e878eea081" + path-exists@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" @@ -3387,9 +3491,9 @@ read-pkg@^1.0.0: normalize-package-data "^2.3.2" path-type "^1.0.0" -"readable-stream@^2.0.0 || ^1.1.13", readable-stream@^2.0.1, readable-stream@^2.0.2: - version "2.2.2" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.2.tgz#a9e6fec3c7dda85f8bb1b3ba7028604556fc825e" +"readable-stream@^2.0.0 || ^1.1.13", readable-stream@^2.0.1, readable-stream@~2.1.4: + version "2.1.5" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.1.5.tgz#66fa8b720e1438b364681f2ad1a63c618448c9d0" dependencies: buffer-shims "^1.0.0" core-util-is "~1.0.0" @@ -3399,16 +3503,7 @@ read-pkg@^1.0.0: string_decoder "~0.10.x" util-deprecate "~1.0.1" -readable-stream@~1.1.9: - version "1.1.14" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9" - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "0.0.1" - string_decoder "~0.10.x" - -readable-stream@~2.0.0: +readable-stream@^2.0.2, readable-stream@~2.0.0: version "2.0.6" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e" dependencies: @@ -3419,17 +3514,14 @@ readable-stream@~2.0.0: string_decoder "~0.10.x" util-deprecate "~1.0.1" -readable-stream@~2.1.4: - version "2.1.5" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.1.5.tgz#66fa8b720e1438b364681f2ad1a63c618448c9d0" +readable-stream@~1.1.9: + version "1.1.14" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9" dependencies: - buffer-shims "^1.0.0" core-util-is "~1.0.0" inherits "~2.0.1" - isarray "~1.0.0" - process-nextick-args "~1.0.6" + isarray "0.0.1" string_decoder "~0.10.x" - util-deprecate "~1.0.1" readdirp@^2.0.0: version "2.1.0" @@ -3538,7 +3630,7 @@ replace-ext@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-0.0.1.tgz#29bbd92078a739f0bcce2b4ee41e837953522924" -request@^2.55.0, request@^2.79.0: +request@^2.55.0, request@^2.65.0, request@^2.79.0: version "2.79.0" resolved "https://registry.yarnpkg.com/request/-/request-2.79.0.tgz#4dfe5bf6be8b8cdc37fcf93e04b65577722710de" dependencies: @@ -3676,10 +3768,24 @@ semver-diff@^2.0.0: dependencies: semver "^5.0.3" +semver-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/semver-regex/-/semver-regex-1.0.0.tgz#92a4969065f9c70c694753d55248fc68f8f652c9" + +semver-truncate@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/semver-truncate/-/semver-truncate-1.1.2.tgz#57f41de69707a62709a7e0104ba2117109ea47e8" + dependencies: + semver "^5.3.0" + "semver@2 || 3 || 4 || 5", semver@^5.0.3, semver@^5.1.0, semver@^5.3.0, semver@~5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" +semver@^4.0.3: + version "4.3.6" + resolved "https://registry.yarnpkg.com/semver/-/semver-4.3.6.tgz#300bc6e0e86374f7ba61068b5b1ecd57fc6532da" + set-blocking@^2.0.0, set-blocking@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" From aea102d7706e26952b6d18e4e024aa3175a3952f Mon Sep 17 00:00:00 2001 From: Orta Therox Date: Fri, 24 Mar 2017 09:14:03 +0000 Subject: [PATCH 04/12] Updates jest dependencies --- .npmignore | 1 + package.json | 8 +- source/dsl/GitDSL.ts | 7 +- .../github/_tests/_GitHubAPI.test.ts | 4 +- source/runner/DangerfileRunner.ts | 11 +- source/runner/_tests/DangerRunner.test.ts | 15 +- .../__snapshots__/DangerRunner.test.ts.snap | 46 +++ yarn.lock | 330 +++--------------- 8 files changed, 133 insertions(+), 289 deletions(-) create mode 100644 source/runner/_tests/__snapshots__/DangerRunner.test.ts.snap diff --git a/.npmignore b/.npmignore index 34c922809..8c9b62a45 100644 --- a/.npmignore +++ b/.npmignore @@ -13,3 +13,4 @@ dangerfile.js env .eslintrc.json jsconfig.json +coverage diff --git a/package.json b/package.json index 73380bc44..5e3c42f44 100644 --- a/package.json +++ b/package.json @@ -90,7 +90,7 @@ "lint-staged": "^3.2.5", "madge": "^1.4.4", "shx": "^0.2.1", - "ts-jest": "^19.0.0", + "ts-jest": "^19.0.2", "ts-node": "^3.0.0", "tslint": "^4.5.1", "typescript": "2.2.1" @@ -100,9 +100,9 @@ "chalk": "^1.1.1", "commander": "^2.9.0", "debug": "^2.6.0", - "jest-config": "^18.0.0", - "jest-environment-node": "^18.1.0", - "jest-runtime": "^18.0.0", + "jest-config": "^19.0.2", + "jest-environment-node": "^19.0.2", + "jest-runtime": "^19.0.2", "jsome": "^2.3.25", "jsonpointer": "^4.0.1", "lodash.find": "^4.6.0", diff --git a/source/dsl/GitDSL.ts b/source/dsl/GitDSL.ts index f174863a7..0948f60fe 100644 --- a/source/dsl/GitDSL.ts +++ b/source/dsl/GitDSL.ts @@ -32,6 +32,11 @@ export interface JSONDiffValue { removed?: any[] } +/** A map of string keys to JSONDiffValue */ +export interface JSONDiff { + [name: string]: JSONDiffValue +} + // This is `danger.git` /** The git specific metadata for a PR */ @@ -85,7 +90,7 @@ export interface GitDSL { * * @param {string} filename the path to the json file */ - JSONDiffForFile(filename: string): Promise, + JSONDiffForFile(filename: string): Promise, /** The Git commit metadata */ readonly commits: Array diff --git a/source/platforms/github/_tests/_GitHubAPI.test.ts b/source/platforms/github/_tests/_GitHubAPI.test.ts index 30aac3b95..a8a547671 100644 --- a/source/platforms/github/_tests/_GitHubAPI.test.ts +++ b/source/platforms/github/_tests/_GitHubAPI.test.ts @@ -61,10 +61,10 @@ describe("Peril", () => { it("Allows setting additional headers", async () => { const mockSource = new FakeCI({}) const api = new GitHubAPI(mockSource, "ABCDE") - api.fetch = fetchJSON + api.fetch = jest.fn() api.additionalHeaders = { "CUSTOM": "HEADER" } - const request = await api.getUserInfo() + const request = await api.get("user") expect(request.headers).toEqual({ Authorization: "token ABCDE", "CUSTOM": "HEADER", diff --git a/source/runner/DangerfileRunner.ts b/source/runner/DangerfileRunner.ts index 0ded15cd0..0c9f2f16a 100644 --- a/source/runner/DangerfileRunner.ts +++ b/source/runner/DangerfileRunner.ts @@ -47,7 +47,7 @@ export async function createDangerfileRuntimeEnvironment(dangerfileContext: Dang * The Jest config object for this Danger run * @returns {any} the results of the run */ -async function dangerJestConfig() { +export async function dangerJestConfig() { // Note: This function is making assumptions that // the Dangerfile is being ran from the CWD @@ -55,8 +55,7 @@ async function dangerJestConfig() { // we can re-use things like haste transformers. // so if you can make you tests run right, // then it's pretty likely that Danger can do it too. - const jestConfig = await readConfig([], process.cwd()) - // console.log(jestConfig) + const jestConfig = await readConfig([], process.cwd()) return { cacheDirectory: os.tmpdir(), setupFiles: [], @@ -66,9 +65,9 @@ async function dangerJestConfig() { }, moduleNameMapper: [], moduleDirectories: [ "node_modules" ], - moduleFileExtensions: ["js", ...jestConfig.moduleFileExtensions], - transform: [["js$", "babel-jest"], ...jestConfig.transform], - testPathIgnorePatterns: jestConfig.testPathIgnorePatterns, + moduleFileExtensions: ["js", ...jestConfig.config.moduleFileExtensions], + transform: [["js$", "babel-jest"], ...jestConfig.config.transform], + testPathIgnorePatterns: jestConfig.config.testPathIgnorePatterns, cache: null, testRegex: "", testPathDirs: [process.cwd()], diff --git a/source/runner/_tests/DangerRunner.test.ts b/source/runner/_tests/DangerRunner.test.ts index 67142edb9..da2501190 100644 --- a/source/runner/_tests/DangerRunner.test.ts +++ b/source/runner/_tests/DangerRunner.test.ts @@ -3,8 +3,10 @@ import { createDangerfileRuntimeEnvironment, runDangerfileEnvironment, updateDangerfile, - cleanDangerfile + cleanDangerfile, + dangerJestConfig } from "../DangerfileRunner" + import {FakeCI} from "../../ci_source/providers/Fake" import {FakePlatform} from "../../platforms/FakePlatform" import {Executor} from "../Executor" @@ -21,7 +23,12 @@ const fixtures = resolve(__dirname, "fixtures") */ async function setupDangerfileContext() { const platform = new FakePlatform() - const exec = new Executor(new FakeCI({}), platform) + const config = { + stdoutOnly: false, + verbose: false + } + + const exec = new Executor(new FakeCI({}), platform, config) platform.getPlatformGitRepresentation = jest.fn() platform.getPlatformDSLRepresentation = jest.fn() @@ -178,3 +185,7 @@ let { danger, warn, fail, message } = require('danger'); expect(cleanDangerfile(before)).toEqual(after) }) }) + +it("creates a working jest config", async () => { + expect(await dangerJestConfig()).toMatchSnapshot() +}) diff --git a/source/runner/_tests/__snapshots__/DangerRunner.test.ts.snap b/source/runner/_tests/__snapshots__/DangerRunner.test.ts.snap new file mode 100644 index 000000000..409c042c4 --- /dev/null +++ b/source/runner/_tests/__snapshots__/DangerRunner.test.ts.snap @@ -0,0 +1,46 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`creates a working jest config 1`] = ` +Object { + "cache": null, + "cacheDirectory": "/var/folders/xk/xbld2_2511b3xc5_8fsfddx40000gn/T", + "haste": Object { + "defaultPlatform": "danger-js", + }, + "moduleDirectories": Array [ + "node_modules", + ], + "moduleFileExtensions": Array [ + "js", + "js", + "jsx", + "json", + "ts", + "tsx", + ], + "moduleNameMapper": Array [], + "name": "danger", + "setupFiles": Array [], + "testPathDirs": Array [ + "/Users/orta/dev/projects/danger/danger-js", + ], + "testPathIgnorePatterns": Array [ + "/node_modules/", + "/distribution/", + ], + "testRegex": "", + "transform": Array [ + Array [ + "js$", + "babel-jest", + ], + Array [ + ".(ts|tsx)", + "/Users/orta/dev/projects/danger/danger-js/node_modules/ts-jest/preprocessor.js", + ], + ], + "transformIgnorePatterns": Array [ + "/node_modules/", + ], +} +`; diff --git a/yarn.lock b/yarn.lock index 2e8c17751..2773dc2fc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -30,7 +30,7 @@ version "6.0.57" resolved "https://registry.yarnpkg.com/@types/node/-/node-6.0.57.tgz#100f9d4390331297bc3b6160ac4805b46de6e752" -abab@^1.0.0, abab@^1.0.3: +abab@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/abab/-/abab-1.0.3.tgz#b81de5f7274ec4e756d797cd834f303642724e5d" @@ -38,22 +38,12 @@ abbrev@1, abbrev@1.0.x: version "1.0.9" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.0.9.tgz#91b4792588a7738c25f35dd6f63752a2f8776135" -acorn-globals@^1.0.4: - version "1.0.9" - resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-1.0.9.tgz#55bb5e98691507b74579d0513413217c380c54cf" - dependencies: - acorn "^2.1.0" - acorn-globals@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-3.1.0.tgz#fd8270f71fbb4996b004fa880ee5d46573a731bf" dependencies: acorn "^4.0.4" -acorn@^2.1.0, acorn@^2.4.0: - version "2.7.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-2.7.0.tgz#ab6e7d9d886aaca8b085bc3312b79a198433f0e7" - acorn@^4.0.4: version "4.0.11" resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.11.tgz#edcda3bd937e7556410d42ed5860f67399c794c0" @@ -393,14 +383,6 @@ babel-helpers@^6.16.0: babel-runtime "^6.0.0" babel-template "^6.16.0" -babel-jest@^18.0.0: - version "18.0.0" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-18.0.0.tgz#17ebba8cb3285c906d859e8707e4e79795fb65e3" - dependencies: - babel-core "^6.0.0" - babel-plugin-istanbul "^3.0.0" - babel-preset-jest "^18.0.0" - babel-jest@^19.0.0: version "19.0.0" resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-19.0.0.tgz#59323ced99a3a84d359da219ca881074ffc6ce3f" @@ -427,15 +409,6 @@ babel-plugin-check-es2015-constants@^6.22.0: dependencies: babel-runtime "^6.22.0" -babel-plugin-istanbul@^3.0.0: - version "3.1.2" - resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-3.1.2.tgz#11d5abde18425ec24b5d648c7e0b5d25cd354a22" - dependencies: - find-up "^1.1.2" - istanbul-lib-instrument "^1.4.2" - object-assign "^4.1.0" - test-exclude "^3.3.0" - babel-plugin-istanbul@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.0.0.tgz#36bde8fbef4837e5ff0366531a2beabd7b1ffa10" @@ -444,10 +417,6 @@ babel-plugin-istanbul@^4.0.0: istanbul-lib-instrument "^1.4.2" test-exclude "^4.0.0" -babel-plugin-jest-hoist@^18.0.0: - version "18.0.0" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-18.0.0.tgz#4150e70ecab560e6e7344adc849498072d34e12a" - babel-plugin-jest-hoist@^19.0.0: version "19.0.0" resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-19.0.0.tgz#4ae2a04ea612a6e73651f3fde52c178991304bea" @@ -732,12 +701,6 @@ babel-preset-es2015@^6.24.0: babel-plugin-transform-es2015-unicode-regex "^6.22.0" babel-plugin-transform-regenerator "^6.22.0" -babel-preset-jest@^18.0.0: - version "18.0.0" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-18.0.0.tgz#84faf8ca3ec65aba7d5e3f59bbaed935ab24049e" - dependencies: - babel-plugin-jest-hoist "^18.0.0" - babel-preset-jest@^19.0.0: version "19.0.0" resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-19.0.0.tgz#22d67201d02324a195811288eb38294bb3cac396" @@ -766,16 +729,16 @@ babel-register@^6.16.0, babel-register@^6.18.0: mkdirp "^0.5.1" source-map-support "^0.4.2" -babel-runtime@^6.0.0, babel-runtime@^6.11.6, babel-runtime@^6.18.0, babel-runtime@^6.20.0, babel-runtime@^6.9.0: - version "6.20.0" - resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.20.0.tgz#87300bdcf4cd770f09bf0048c64204e17806d16f" +babel-runtime@^6.0.0, babel-runtime@^6.11.6, babel-runtime@^6.18.0, babel-runtime@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.23.0.tgz#0a9489f144de70efb3ce4300accdb329e2fc543b" dependencies: core-js "^2.4.0" regenerator-runtime "^0.10.0" -babel-runtime@^6.22.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.23.0.tgz#0a9489f144de70efb3ce4300accdb329e2fc543b" +babel-runtime@^6.20.0, babel-runtime@^6.9.0: + version "6.20.0" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.20.0.tgz#87300bdcf4cd770f09bf0048c64204e17806d16f" dependencies: core-js "^2.4.0" regenerator-runtime "^0.10.0" @@ -800,21 +763,7 @@ babel-template@^6.22.0, babel-template@^6.23.0: babylon "^6.11.0" lodash "^4.2.0" -babel-traverse@^6.16.0, babel-traverse@^6.18.0, babel-traverse@^6.21.0: - version "6.21.0" - resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.21.0.tgz#69c6365804f1a4f69eb1213f85b00a818b8c21ad" - dependencies: - babel-code-frame "^6.20.0" - babel-messages "^6.8.0" - babel-runtime "^6.20.0" - babel-types "^6.21.0" - babylon "^6.11.0" - debug "^2.2.0" - globals "^9.0.0" - invariant "^2.2.0" - lodash "^4.2.0" - -babel-traverse@^6.22.0, babel-traverse@^6.23.0: +babel-traverse@^6.16.0, babel-traverse@^6.18.0, babel-traverse@^6.22.0, babel-traverse@^6.23.0: version "6.23.1" resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.23.1.tgz#d3cb59010ecd06a97d81310065f966b699e14f48" dependencies: @@ -828,16 +777,21 @@ babel-traverse@^6.22.0, babel-traverse@^6.23.0: invariant "^2.2.0" lodash "^4.2.0" -babel-types@^6.16.0, babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.21.0: +babel-traverse@^6.21.0: version "6.21.0" - resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.21.0.tgz#314b92168891ef6d3806b7f7a917fdf87c11a4b2" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.21.0.tgz#69c6365804f1a4f69eb1213f85b00a818b8c21ad" dependencies: + babel-code-frame "^6.20.0" + babel-messages "^6.8.0" babel-runtime "^6.20.0" - esutils "^2.0.2" + babel-types "^6.21.0" + babylon "^6.11.0" + debug "^2.2.0" + globals "^9.0.0" + invariant "^2.2.0" lodash "^4.2.0" - to-fast-properties "^1.0.1" -babel-types@^6.22.0, babel-types@^6.23.0: +babel-types@^6.16.0, babel-types@^6.18.0, babel-types@^6.22.0, babel-types@^6.23.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.23.0.tgz#bb17179d7538bad38cd0c9e115d340f77e7e9acf" dependencies: @@ -846,6 +800,15 @@ babel-types@^6.22.0, babel-types@^6.23.0: lodash "^4.2.0" to-fast-properties "^1.0.1" +babel-types@^6.19.0, babel-types@^6.21.0: + version "6.21.0" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.21.0.tgz#314b92168891ef6d3806b7f7a917fdf87c11a4b2" + dependencies: + babel-runtime "^6.20.0" + esutils "^2.0.2" + lodash "^4.2.0" + to-fast-properties "^1.0.1" + babylon@^6.11.0, babylon@^6.13.0: version "6.14.1" resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.14.1.tgz#956275fab72753ad9b3435d7afe58f8bf0a29815" @@ -1206,15 +1169,11 @@ crypto-random-string@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-1.0.0.tgz#a230f64f568310e1498009940790ec99545bca7e" -cssom@0.3.x, "cssom@>= 0.3.0 < 0.4.0": - version "0.3.1" - resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.1.tgz#c9e37ef2490e64f6d1baa10fda852257082c25d3" - -"cssom@>= 0.3.2 < 0.4.0": +cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0": version "0.3.2" resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.2.tgz#b8036170c79f07a90ff2f16e22284027a243848b" -"cssstyle@>= 0.2.36 < 0.3.0", "cssstyle@>= 0.2.37 < 0.3.0": +"cssstyle@>= 0.2.37 < 0.3.0": version "0.2.37" resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-0.2.37.tgz#541097234cb2513c83ceed3acddc27ff27987d54" dependencies: @@ -1489,7 +1448,7 @@ fast-levenshtein@~2.0.4: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" -fb-watchman@^1.8.0, fb-watchman@^1.9.0: +fb-watchman@^1.8.0: version "1.9.0" resolved "http://registry.npmjs.org/fb-watchman/-/fb-watchman-1.9.0.tgz#6f268f1f347a6b3c875d1e89da7e1ed79adfc0ec" dependencies: @@ -1554,7 +1513,7 @@ find-parent-dir@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/find-parent-dir/-/find-parent-dir-0.3.0.tgz#33c44b429ab2b2f0646299c5f9f718f376ff8d54" -find-up@^1.0.0, find-up@^1.1.2: +find-up@^1.0.0: version "1.1.2" resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" dependencies: @@ -1610,6 +1569,13 @@ form-data@~2.1.1: combined-stream "^1.0.5" mime-types "^2.1.12" +fs-extra@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-2.1.2.tgz#046c70163cef9aad46b0e4a7fa467fb22d71de35" + dependencies: + graceful-fs "^4.1.2" + jsonfile "^2.1.0" + fs-extra@~0.6.4: version "0.6.4" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-0.6.4.tgz#f46f0c75b7841f8d200b3348cd4d691d5a099d15" @@ -1916,7 +1882,7 @@ iconv-lite@0.4.13: version "0.4.13" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.13.tgz#1f88aba4ab0b1508e8312acc39345f36e992e2f2" -iconv-lite@^0.4.13, iconv-lite@~0.4.13: +iconv-lite@~0.4.13: version "0.4.15" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.15.tgz#fe265a218ac6a57cfe854927e9d04c19825eddeb" @@ -2239,19 +2205,6 @@ jest-cli@^19.0.2: worker-farm "^1.3.1" yargs "^6.3.0" -jest-config@^18.0.0, jest-config@^18.1.0: - version "18.1.0" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-18.1.0.tgz#6111740a6d48aab86ff5a9e6ab0b98bd993b6ff4" - dependencies: - chalk "^1.1.1" - jest-environment-jsdom "^18.1.0" - jest-environment-node "^18.1.0" - jest-jasmine2 "^18.1.0" - jest-mock "^18.0.0" - jest-resolve "^18.1.0" - jest-util "^18.1.0" - json-stable-stringify "^1.0.0" - jest-config@^19.0.0, jest-config@^19.0.2: version "19.0.2" resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-19.0.2.tgz#1b9bd2db0ddd16df61c2b10a54009e1768da6411" @@ -2265,15 +2218,6 @@ jest-config@^19.0.0, jest-config@^19.0.2: jest-validate "^19.0.2" pretty-format "^19.0.0" -jest-diff@^18.1.0: - version "18.1.0" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-18.1.0.tgz#4ff79e74dd988c139195b365dc65d87f606f4803" - dependencies: - chalk "^1.1.3" - diff "^3.0.0" - jest-matcher-utils "^18.1.0" - pretty-format "^18.1.0" - jest-diff@^19.0.0: version "19.0.0" resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-19.0.0.tgz#d1563cfc56c8b60232988fbc05d4d16ed90f063c" @@ -2283,14 +2227,6 @@ jest-diff@^19.0.0: jest-matcher-utils "^19.0.0" pretty-format "^19.0.0" -jest-environment-jsdom@^18.1.0: - version "18.1.0" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-18.1.0.tgz#18b42f0c4ea2bae9f36cab3639b1e8f8c384e24e" - dependencies: - jest-mock "^18.0.0" - jest-util "^18.1.0" - jsdom "^9.9.1" - jest-environment-jsdom@^19.0.2: version "19.0.2" resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-19.0.2.tgz#ceda859c4a4b94ab35e4de7dab54b926f293e4a3" @@ -2299,13 +2235,6 @@ jest-environment-jsdom@^19.0.2: jest-util "^19.0.2" jsdom "^9.11.0" -jest-environment-node@^18.1.0: - version "18.1.0" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-18.1.0.tgz#4d6797572c8dda99acf5fae696eb62945547c779" - dependencies: - jest-mock "^18.0.0" - jest-util "^18.1.0" - jest-environment-node@^19.0.2: version "19.0.2" resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-19.0.2.tgz#6e84079db87ed21d0c05e1f9669f207b116fe99b" @@ -2313,24 +2242,10 @@ jest-environment-node@^19.0.2: jest-mock "^19.0.0" jest-util "^19.0.2" -jest-file-exists@^17.0.0: - version "17.0.0" - resolved "https://registry.yarnpkg.com/jest-file-exists/-/jest-file-exists-17.0.0.tgz#7f63eb73a1c43a13f461be261768b45af2cdd169" - jest-file-exists@^19.0.0: version "19.0.0" resolved "https://registry.yarnpkg.com/jest-file-exists/-/jest-file-exists-19.0.0.tgz#cca2e587a11ec92e24cfeab3f8a94d657f3fceb8" -jest-haste-map@^18.1.0: - version "18.1.0" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-18.1.0.tgz#06839c74b770a40c1a106968851df8d281c08375" - dependencies: - fb-watchman "^1.9.0" - graceful-fs "^4.1.6" - micromatch "^2.3.11" - sane "~1.4.1" - worker-farm "^1.3.1" - jest-haste-map@^19.0.0: version "19.0.0" resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-19.0.0.tgz#adde00b62b1fe04432a104b3254fc5004514b55e" @@ -2341,16 +2256,6 @@ jest-haste-map@^19.0.0: sane "~1.5.0" worker-farm "^1.3.1" -jest-jasmine2@^18.1.0: - version "18.1.0" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-18.1.0.tgz#094e104c2c189708766c77263bb2aecb5860a80b" - dependencies: - graceful-fs "^4.1.6" - jest-matcher-utils "^18.1.0" - jest-matchers "^18.1.0" - jest-snapshot "^18.1.0" - jest-util "^18.1.0" - jest-jasmine2@^19.0.2: version "19.0.2" resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-19.0.2.tgz#167991ac825981fb1a800af126e83afcca832c73" @@ -2361,13 +2266,6 @@ jest-jasmine2@^19.0.2: jest-message-util "^19.0.0" jest-snapshot "^19.0.2" -jest-matcher-utils@^18.1.0: - version "18.1.0" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-18.1.0.tgz#1ac4651955ee2a60cef1e7fcc98cdfd773c0f932" - dependencies: - chalk "^1.1.3" - pretty-format "^18.1.0" - jest-matcher-utils@^19.0.0: version "19.0.0" resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-19.0.0.tgz#5ecd9b63565d2b001f61fbf7ec4c7f537964564d" @@ -2375,15 +2273,6 @@ jest-matcher-utils@^19.0.0: chalk "^1.1.3" pretty-format "^19.0.0" -jest-matchers@^18.1.0: - version "18.1.0" - resolved "https://registry.yarnpkg.com/jest-matchers/-/jest-matchers-18.1.0.tgz#0341484bf87a1fd0bac0a4d2c899e2b77a3f1ead" - dependencies: - jest-diff "^18.1.0" - jest-matcher-utils "^18.1.0" - jest-util "^18.1.0" - pretty-format "^18.1.0" - jest-matchers@^19.0.0: version "19.0.0" resolved "https://registry.yarnpkg.com/jest-matchers/-/jest-matchers-19.0.0.tgz#c74ecc6ebfec06f384767ba4d6fa4a42d6755754" @@ -2400,10 +2289,6 @@ jest-message-util@^19.0.0: chalk "^1.1.1" micromatch "^2.3.11" -jest-mock@^18.0.0: - version "18.0.0" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-18.0.0.tgz#5c248846ea33fa558b526f5312ab4a6765e489b3" - jest-mock@^19.0.0: version "19.0.0" resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-19.0.0.tgz#67038641e9607ab2ce08ec4a8cb83aabbc899d01" @@ -2418,15 +2303,6 @@ jest-resolve-dependencies@^19.0.0: dependencies: jest-file-exists "^19.0.0" -jest-resolve@^18.1.0: - version "18.1.0" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-18.1.0.tgz#6800accb536658c906cd5e29de412b1ab9ac249b" - dependencies: - browser-resolve "^1.11.2" - jest-file-exists "^17.0.0" - jest-haste-map "^18.1.0" - resolve "^1.2.0" - jest-resolve@^19.0.2: version "19.0.2" resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-19.0.2.tgz#5793575de4f07aec32f7d7ff0c6c181963eefb3c" @@ -2435,26 +2311,6 @@ jest-resolve@^19.0.2: jest-haste-map "^19.0.0" resolve "^1.2.0" -jest-runtime@^18.0.0: - version "18.1.0" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-18.1.0.tgz#3abfd687175b21fc3b85a2b8064399e997859922" - dependencies: - babel-core "^6.0.0" - babel-jest "^18.0.0" - babel-plugin-istanbul "^3.0.0" - chalk "^1.1.3" - graceful-fs "^4.1.6" - jest-config "^18.1.0" - jest-file-exists "^17.0.0" - jest-haste-map "^18.1.0" - jest-mock "^18.0.0" - jest-resolve "^18.1.0" - jest-snapshot "^18.1.0" - jest-util "^18.1.0" - json-stable-stringify "^1.0.0" - micromatch "^2.3.11" - yargs "^6.3.0" - jest-runtime@^19.0.2: version "19.0.2" resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-19.0.2.tgz#d9a43e72de416d27d196fd9c7940d98fe6685407" @@ -2475,17 +2331,6 @@ jest-runtime@^19.0.2: strip-bom "3.0.0" yargs "^6.3.0" -jest-snapshot@^18.1.0: - version "18.1.0" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-18.1.0.tgz#55b96d2ee639c9bce76f87f2a3fd40b71c7a5916" - dependencies: - jest-diff "^18.1.0" - jest-file-exists "^17.0.0" - jest-matcher-utils "^18.1.0" - jest-util "^18.1.0" - natural-compare "^1.4.0" - pretty-format "^18.1.0" - jest-snapshot@^19.0.2: version "19.0.2" resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-19.0.2.tgz#9c1b216214f7187c38bfd5c70b1efab16b0ff50b" @@ -2498,17 +2343,6 @@ jest-snapshot@^19.0.2: natural-compare "^1.4.0" pretty-format "^19.0.0" -jest-util@^18.1.0: - version "18.1.0" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-18.1.0.tgz#3a99c32114ab17f84be094382527006e6d4bfc6a" - dependencies: - chalk "^1.1.1" - diff "^3.0.0" - graceful-fs "^4.1.6" - jest-file-exists "^17.0.0" - jest-mock "^18.0.0" - mkdirp "^0.5.1" - jest-util@^19.0.0, jest-util@^19.0.2: version "19.0.2" resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-19.0.2.tgz#e0a0232a2ab9e6b2b53668bdb3534c2b5977ed41" @@ -2586,31 +2420,6 @@ jsdom@^9.11.0: whatwg-url "^4.3.0" xml-name-validator "^2.0.1" -jsdom@^9.9.1: - version "9.9.1" - resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-9.9.1.tgz#84f3972ad394ab963233af8725211bce4d01bfd5" - dependencies: - abab "^1.0.0" - acorn "^2.4.0" - acorn-globals "^1.0.4" - array-equal "^1.0.0" - content-type-parser "^1.0.1" - cssom ">= 0.3.0 < 0.4.0" - cssstyle ">= 0.2.36 < 0.3.0" - escodegen "^1.6.1" - html-encoding-sniffer "^1.0.1" - iconv-lite "^0.4.13" - nwmatcher ">= 1.3.9 < 2.0.0" - parse5 "^1.5.1" - request "^2.55.0" - sax "^1.1.4" - symbol-tree ">= 3.1.0 < 4.0.0" - tough-cookie "^2.3.1" - webidl-conversions "^3.0.1" - whatwg-encoding "^1.0.1" - whatwg-url "^4.1.0" - xml-name-validator ">= 2.0.1 < 3.0.0" - jsesc@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" @@ -2631,7 +2440,7 @@ json-schema@0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" -json-stable-stringify@^1.0.0, json-stable-stringify@^1.0.1: +json-stable-stringify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" dependencies: @@ -2645,6 +2454,12 @@ json5@^0.5.0: version "0.5.1" resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" +jsonfile@^2.1.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8" + optionalDependencies: + graceful-fs "^4.1.6" + jsonfile@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-1.0.1.tgz#ea5efe40b83690b98667614a7392fc60e842c0dd" @@ -3424,12 +3239,6 @@ preserve@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" -pretty-format@^18.1.0: - version "18.1.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-18.1.0.tgz#fb65a86f7a7f9194963eee91865c1bcf1039e284" - dependencies: - ansi-styles "^2.2.1" - pretty-format@^19.0.0: version "19.0.0" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-19.0.0.tgz#56530d32acb98a3fa4851c4e2b9d37b420684c84" @@ -3630,7 +3439,7 @@ replace-ext@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-0.0.1.tgz#29bbd92078a739f0bcce2b4ee41e837953522924" -request@^2.55.0, request@^2.65.0, request@^2.79.0: +request@^2.65.0, request@^2.79.0: version "2.79.0" resolved "https://registry.yarnpkg.com/request/-/request-2.79.0.tgz#4dfe5bf6be8b8cdc37fcf93e04b65577722710de" dependencies: @@ -3728,17 +3537,6 @@ safe-buffer@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.0.1.tgz#d263ca54696cd8a306b5ca6551e92de57918fbe7" -sane@~1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/sane/-/sane-1.4.1.tgz#88f763d74040f5f0c256b6163db399bf110ac715" - dependencies: - exec-sh "^0.2.0" - fb-watchman "^1.8.0" - minimatch "^3.0.2" - minimist "^1.1.1" - walker "~1.0.5" - watch "~0.10.0" - sane@~1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/sane/-/sane-1.5.0.tgz#a4adeae764d048621ecb27d5f9ecf513101939f3" @@ -3758,7 +3556,7 @@ sass-lookup@^1.0.2: commander "~2.8.1" is-relative-path "~1.0.0" -sax@^1.1.4, sax@^1.2.1: +sax@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.1.tgz#7b8e656190b228e81a66aea748480d828cd2d37a" @@ -3996,7 +3794,7 @@ symbol-observable@^1.0.1: version "1.0.4" resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.4.tgz#29bf615d4aa7121bdd898b22d4b3f9bc4e2aa03d" -"symbol-tree@>= 3.1.0 < 4.0.0", symbol-tree@^3.2.1: +symbol-tree@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.1.tgz#8549dd1d01fa9f893c18cc9ab0b106b4d9b168cb" @@ -4035,16 +3833,6 @@ term-size@^0.1.0: dependencies: execa "^0.4.0" -test-exclude@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-3.3.0.tgz#7a17ca1239988c98367b0621456dbb7d4bc38977" - dependencies: - arrify "^1.0.1" - micromatch "^2.3.11" - object-assign "^4.1.0" - read-pkg-up "^1.0.1" - require-main-filename "^1.0.1" - test-exclude@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.0.0.tgz#0ddc0100b8ae7e88b34eb4fd98a907e961991900" @@ -4094,7 +3882,7 @@ to-fast-properties@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.2.tgz#f3f5c0c3ba7299a7ef99427e44633257ade43320" -tough-cookie@^2.3.1, tough-cookie@^2.3.2, tough-cookie@~2.3.0: +tough-cookie@^2.3.2, tough-cookie@~2.3.0: version "2.3.2" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.2.tgz#f081f76e4c85720e6c37a5faced737150d84072a" dependencies: @@ -4112,10 +3900,11 @@ trim-newlines@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613" -ts-jest@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-19.0.0.tgz#b1005f06dd3338681e9f0227ea8c014b26735287" +ts-jest@^19.0.2: + version "19.0.2" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-19.0.2.tgz#1d0f0f2ffff97695ff8c09873b371167d6f4aea6" dependencies: + fs-extra "^2.1.2" glob-all "^3.1.0" istanbul-lib-instrument "^1.2.0" jest-config "^19.0.0" @@ -4291,7 +4080,7 @@ watch@~0.10.0: version "0.10.0" resolved "https://registry.yarnpkg.com/watch/-/watch-0.10.0.tgz#77798b2da0f9910d595f1ace5b0c2258521f21dc" -webidl-conversions@^3.0.0, webidl-conversions@^3.0.1: +webidl-conversions@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" @@ -4305,13 +4094,6 @@ whatwg-encoding@^1.0.1: dependencies: iconv-lite "0.4.13" -whatwg-url@^4.1.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-4.2.0.tgz#abf1a3f5ff4bc2005b3f0c2119382631789d8e44" - dependencies: - tr46 "~0.0.3" - webidl-conversions "^3.0.0" - whatwg-url@^4.3.0: version "4.5.1" resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-4.5.1.tgz#ba634f630ff0778212c52ea9055d2d061380b1bb" @@ -4391,7 +4173,7 @@ xdg-basedir@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-3.0.0.tgz#496b2cc109eca8dbacfe2dc72b603c17c5870ad4" -"xml-name-validator@>= 2.0.1 < 3.0.0", xml-name-validator@^2.0.1: +xml-name-validator@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-2.0.1.tgz#4d8b8f1eccd3419aa362061becef515e1e559635" From 68c0c3a30354911ab75cc8354be7af4cfba8c9ef Mon Sep 17 00:00:00 2001 From: Orta Therox Date: Fri, 24 Mar 2017 09:16:59 +0000 Subject: [PATCH 05/12] Update the declarations --- source/danger.d.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/danger.d.ts b/source/danger.d.ts index 97738e420..181dcbe5a 100644 --- a/source/danger.d.ts +++ b/source/danger.d.ts @@ -140,6 +140,11 @@ export interface JSONDiffValue { removed?: any[] } +/** A map of string keys to JSONDiffValue */ +export interface JSONDiff { + [name: string]: JSONDiffValue +} + // This is `danger.git` /** The git specific metadata for a PR */ @@ -190,7 +195,7 @@ export interface GitDSL { * * @param {string} filename the path to the json file */ - JSONDiffForFile(filename: string): Promise, + JSONDiffForFile(filename: string): Promise, /** The Git commit metadata */ readonly commits: Array From fe0f8b2f979d8e2f0dd389f243918dce1b53c669 Mon Sep 17 00:00:00 2001 From: Orta Therox Date: Fri, 24 Mar 2017 09:18:47 +0000 Subject: [PATCH 06/12] CHANGELOG --- changelog.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index d86d7a7bc..7c3738c0f 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,9 @@ ### master -// Add your own contribution below +// Add your own contribution below, ideally with a consumer's perspective in mind. + +* Updated jest-* dependencies to 19.x - orta +* Added type shapings to `JSONPatchForFile` - orta ### 0.14.2 From d91fc3047318d0f4cafb6a10b1f7c758cc832d87 Mon Sep 17 00:00:00 2001 From: Orta Therox Date: Fri, 24 Mar 2017 09:22:31 +0000 Subject: [PATCH 07/12] Make green --- source/platforms/github/_tests/_GitHubAPI.test.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/source/platforms/github/_tests/_GitHubAPI.test.ts b/source/platforms/github/_tests/_GitHubAPI.test.ts index a8a547671..1ed342087 100644 --- a/source/platforms/github/_tests/_GitHubAPI.test.ts +++ b/source/platforms/github/_tests/_GitHubAPI.test.ts @@ -65,10 +65,12 @@ describe("Peril", () => { api.additionalHeaders = { "CUSTOM": "HEADER" } const request = await api.get("user") - expect(request.headers).toEqual({ - Authorization: "token ABCDE", + expect(api.fetch).toHaveBeenCalledWith("https://api.github.com/user", + {"body": {}, "headers": { + "Authorization": "token ABCDE", "CUSTOM": "HEADER", - "Content-Type": "application/json", - }) + "Content-Type": "application/json" + }, "method": "GET"} + ) }) }) From 83cbce03b1b2c282ab73daad48385c12e9be67f6 Mon Sep 17 00:00:00 2001 From: Orta Therox Date: Fri, 24 Mar 2017 09:30:56 +0000 Subject: [PATCH 08/12] Update test for config object to not show per-dev paths --- dangerfile.ts | 4 ++++ source/runner/_tests/DangerRunner.test.ts | 15 ++++++++++++++- .../__snapshots__/DangerRunner.test.ts.snap | 9 ++++----- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/dangerfile.ts b/dangerfile.ts index 9265ea84d..81d8e01c2 100644 --- a/dangerfile.ts +++ b/dangerfile.ts @@ -118,6 +118,10 @@ import dtsGenerator from "./scripts/danger-dts" const currentDTS = dtsGenerator() const savedDTS = fs.readFileSync("source/danger.d.ts").toString() if (currentDTS !== savedDTS) { + console.log("Current:") + console.log(currentDTS) + console.log("New:") + console.log(savedDTS) const message = "There are changes to the Danger DSL which are not reflected in the current danger.d.ts." const idea = "Please run yarn declarations and update this PR." fail(`${message}
${idea}`) diff --git a/source/runner/_tests/DangerRunner.test.ts b/source/runner/_tests/DangerRunner.test.ts index da2501190..09beb507b 100644 --- a/source/runner/_tests/DangerRunner.test.ts +++ b/source/runner/_tests/DangerRunner.test.ts @@ -187,5 +187,18 @@ let { danger, warn, fail, message } = require('danger'); }) it("creates a working jest config", async () => { - expect(await dangerJestConfig()).toMatchSnapshot() + const config = await dangerJestConfig() + // OK, this is almost perfect, but well, everyone has different paths. + // So we'll amend the ones that should be different per developer/CI + config.cacheDirectory = "[cache]" + config.testPathDirs = ["[testPathDirs]"] + config.testPathIgnorePatterns = ["[testPathIgnorePatterns]"] + + const cwd = process.cwd() + config.transform = config.transform.map(([files, transformer]) => { + const trans = transformer.includes("ts-jest") ? "[ts-jest-transformer]" : transformer + return [files, trans] + }) + + expect(config).toMatchSnapshot() }) diff --git a/source/runner/_tests/__snapshots__/DangerRunner.test.ts.snap b/source/runner/_tests/__snapshots__/DangerRunner.test.ts.snap index 409c042c4..5724b5db0 100644 --- a/source/runner/_tests/__snapshots__/DangerRunner.test.ts.snap +++ b/source/runner/_tests/__snapshots__/DangerRunner.test.ts.snap @@ -3,7 +3,7 @@ exports[`creates a working jest config 1`] = ` Object { "cache": null, - "cacheDirectory": "/var/folders/xk/xbld2_2511b3xc5_8fsfddx40000gn/T", + "cacheDirectory": "[cache]", "haste": Object { "defaultPlatform": "danger-js", }, @@ -22,11 +22,10 @@ Object { "name": "danger", "setupFiles": Array [], "testPathDirs": Array [ - "/Users/orta/dev/projects/danger/danger-js", + "[testPathDirs]", ], "testPathIgnorePatterns": Array [ - "/node_modules/", - "/distribution/", + "[testPathIgnorePatterns]", ], "testRegex": "", "transform": Array [ @@ -36,7 +35,7 @@ Object { ], Array [ ".(ts|tsx)", - "/Users/orta/dev/projects/danger/danger-js/node_modules/ts-jest/preprocessor.js", + "[ts-jest-transformer]", ], ], "transformIgnorePatterns": Array [ From 08ab978cc4a311f3f71143632e7e7c8328827e08 Mon Sep 17 00:00:00 2001 From: Orta Therox Date: Fri, 24 Mar 2017 10:11:12 +0000 Subject: [PATCH 09/12] Merge master --- dangerfile.ts | 4 ---- source/danger.d.ts | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/dangerfile.ts b/dangerfile.ts index 81d8e01c2..9265ea84d 100644 --- a/dangerfile.ts +++ b/dangerfile.ts @@ -118,10 +118,6 @@ import dtsGenerator from "./scripts/danger-dts" const currentDTS = dtsGenerator() const savedDTS = fs.readFileSync("source/danger.d.ts").toString() if (currentDTS !== savedDTS) { - console.log("Current:") - console.log(currentDTS) - console.log("New:") - console.log(savedDTS) const message = "There are changes to the Danger DSL which are not reflected in the current danger.d.ts." const idea = "Please run yarn declarations and update this PR." fail(`${message}
${idea}`) diff --git a/source/danger.d.ts b/source/danger.d.ts index 181dcbe5a..514048c00 100644 --- a/source/danger.d.ts +++ b/source/danger.d.ts @@ -1,6 +1,6 @@ export type MarkdownString = string -/** A platform agnostic refernce to a Git commit */ +/** A platform agnostic reference to a Git commit */ export interface GitCommit { /** The SHA for the commit */ sha: string, From 12345b150a95b977d9bf6ff92cf2bca1e7e2a008 Mon Sep 17 00:00:00 2001 From: Orta Therox Date: Fri, 24 Mar 2017 10:48:32 +0000 Subject: [PATCH 10/12] Allow DangerRunner tests to take longer than other tests --- source/runner/_tests/DangerRunner.test.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/source/runner/_tests/DangerRunner.test.ts b/source/runner/_tests/DangerRunner.test.ts index 09beb507b..92abbc5de 100644 --- a/source/runner/_tests/DangerRunner.test.ts +++ b/source/runner/_tests/DangerRunner.test.ts @@ -37,8 +37,17 @@ async function setupDangerfileContext() { return contextForDanger(dsl) } +declare const jasmine: any + +beforeEach(() => { + if (process.platform === "win32") { + // ten seconds to allow for slow CI, sorry peeps. Use the watcher ;) + jasmine.DEFAULT_TIMEOUT_INTERVAL = 100000 + } +}) + describe("with fixtures", () => { - it("handles a blank Dangerfile", async () => { + it.only("handles a blank Dangerfile", async () => { const context = await setupDangerfileContext() const runtime = await createDangerfileRuntimeEnvironment(context) const results = await runDangerfileEnvironment(resolve(fixtures, "__DangerfileEmpty.js"), runtime) From e670d43c29994da05f57260a9b8d3d30ee31935e Mon Sep 17 00:00:00 2001 From: Orta Therox Date: Fri, 24 Mar 2017 12:22:20 +0000 Subject: [PATCH 11/12] Don't run dangerfile tests in windows --- changelog.md | 4 + source/runner/DangerfileRunner.ts | 1 + source/runner/_tests/DangerRunner.test.ts | 257 +++++++++--------- .../__snapshots__/DangerRunner.test.ts.snap | 1 + 4 files changed, 131 insertions(+), 132 deletions(-) diff --git a/changelog.md b/changelog.md index 7c3738c0f..b7ae3d762 100644 --- a/changelog.md +++ b/changelog.md @@ -3,6 +3,10 @@ // Add your own contribution below, ideally with a consumer's perspective in mind. * Updated jest-* dependencies to 19.x - orta + + Updating the jest-* dependencies seems to be exhibiting strange behavior in tests for windows if you update, and + use windows, can you please confirm that everything is 👍 + * Added type shapings to `JSONPatchForFile` - orta ### 0.14.2 diff --git a/source/runner/DangerfileRunner.ts b/source/runner/DangerfileRunner.ts index 0c9f2f16a..a4467e8a3 100644 --- a/source/runner/DangerfileRunner.ts +++ b/source/runner/DangerfileRunner.ts @@ -60,6 +60,7 @@ export async function dangerJestConfig() { cacheDirectory: os.tmpdir(), setupFiles: [], name: "danger", + testEnvironment: "node", haste: { defaultPlatform: "danger-js" }, diff --git a/source/runner/_tests/DangerRunner.test.ts b/source/runner/_tests/DangerRunner.test.ts index 92abbc5de..ad6b24585 100644 --- a/source/runner/_tests/DangerRunner.test.ts +++ b/source/runner/_tests/DangerRunner.test.ts @@ -37,177 +37,170 @@ async function setupDangerfileContext() { return contextForDanger(dsl) } -declare const jasmine: any - -beforeEach(() => { - if (process.platform === "win32") { - // ten seconds to allow for slow CI, sorry peeps. Use the watcher ;) - jasmine.DEFAULT_TIMEOUT_INTERVAL = 100000 - } -}) - -describe("with fixtures", () => { - it.only("handles a blank Dangerfile", async () => { - const context = await setupDangerfileContext() - const runtime = await createDangerfileRuntimeEnvironment(context) - const results = await runDangerfileEnvironment(resolve(fixtures, "__DangerfileEmpty.js"), runtime) - - expect(results).toEqual({ - fails: [], - markdowns: [], - messages: [], - warnings: [] +if (process.platform !== "win32") { + describe("with fixtures", () => { + it("handles a blank Dangerfile", async () => { + const context = await setupDangerfileContext() + const runtime = await createDangerfileRuntimeEnvironment(context) + const results = await runDangerfileEnvironment(resolve(fixtures, "__DangerfileEmpty.js"), runtime) + + expect(results).toEqual({ + fails: [], + markdowns: [], + messages: [], + warnings: [] + }) }) - }) - - it("handles a full set of messages", async () => { - const context = await setupDangerfileContext() - const runtime = await createDangerfileRuntimeEnvironment(context) - const results = await runDangerfileEnvironment(resolve(fixtures, "__DangerfileFullMessages.js"), runtime) - expect(results).toEqual({ - fails: [{"message": "this is a failure"}], - markdowns: ["this is a *markdown*"], - messages: [{"message": "this is a message"}], - warnings: [{"message": "this is a warning"}] + it("handles a full set of messages", async () => { + const context = await setupDangerfileContext() + const runtime = await createDangerfileRuntimeEnvironment(context) + const results = await runDangerfileEnvironment(resolve(fixtures, "__DangerfileFullMessages.js"), runtime) + + expect(results).toEqual({ + fails: [{"message": "this is a failure"}], + markdowns: ["this is a *markdown*"], + messages: [{"message": "this is a message"}], + warnings: [{"message": "this is a warning"}] + }) }) - }) - it("handles a failing dangerfile", async () => { - const context = await setupDangerfileContext() - const runtime = await createDangerfileRuntimeEnvironment(context) + it("handles a failing dangerfile", async () => { + const context = await setupDangerfileContext() + const runtime = await createDangerfileRuntimeEnvironment(context) - try { - await runDangerfileEnvironment(resolve(fixtures, "__DangerfileBadSyntax.js"), runtime) - throw new Error("Do not get to this") - } - catch (e) { - // expect(e.message === ("Do not get to this")).toBeFalsy() - expect(e.message).toEqual("hello is not defined") - } - }) + try { + await runDangerfileEnvironment(resolve(fixtures, "__DangerfileBadSyntax.js"), runtime) + throw new Error("Do not get to this") + } + catch (e) { + // expect(e.message === ("Do not get to this")).toBeFalsy() + expect(e.message).toEqual("hello is not defined") + } + }) - it("handles relative imports correctly", async () => { - const context = await setupDangerfileContext() - const runtime = await createDangerfileRuntimeEnvironment(context) - await runDangerfileEnvironment(resolve(fixtures, "__DangerfileImportRelative.js"), runtime) - }) + it("handles relative imports correctly", async () => { + const context = await setupDangerfileContext() + const runtime = await createDangerfileRuntimeEnvironment(context) + await runDangerfileEnvironment(resolve(fixtures, "__DangerfileImportRelative.js"), runtime) + }) - it("handles scheduled (async) code", async () => { - const context = await setupDangerfileContext() - const runtime = await createDangerfileRuntimeEnvironment(context) - const results = await runDangerfileEnvironment(resolve(fixtures, "__DangerfileScheduled.js"), runtime) - expect(results).toEqual({ - fails: [], - messages: [], - markdowns: [], - warnings: [{ message: "Asynchronous Warning" }], + it("handles scheduled (async) code", async () => { + const context = await setupDangerfileContext() + const runtime = await createDangerfileRuntimeEnvironment(context) + const results = await runDangerfileEnvironment(resolve(fixtures, "__DangerfileScheduled.js"), runtime) + expect(results).toEqual({ + fails: [], + messages: [], + markdowns: [], + warnings: [{ message: "Asynchronous Warning" }], + }) }) - }) - it("handles multiple scheduled statements and all message types", async () => { - const context = await setupDangerfileContext() - const runtime = await createDangerfileRuntimeEnvironment(context) - const results = await runDangerfileEnvironment(resolve(fixtures, "__DangerfileMultiScheduled.js"), runtime) - expect(results).toEqual({ - fails: [{ message: "Asynchronous Failure" }], - messages: [{ message: "Asynchronous Message" }], - markdowns: ["Asynchronous Markdown"], - warnings: [{ message: "Asynchronous Warning" }], + it("handles multiple scheduled statements and all message types", async () => { + const context = await setupDangerfileContext() + const runtime = await createDangerfileRuntimeEnvironment(context) + const results = await runDangerfileEnvironment(resolve(fixtures, "__DangerfileMultiScheduled.js"), runtime) + expect(results).toEqual({ + fails: [{ message: "Asynchronous Failure" }], + messages: [{ message: "Asynchronous Message" }], + markdowns: ["Asynchronous Markdown"], + warnings: [{ message: "Asynchronous Warning" }], + }) }) - }) - // This adds > 6 seconds to the tests! Only orta should be forced into that. - if (process.env["USER"] === "orta") { - it("can execute async/await scheduled functions", async () => { - // this test takes *forever* because of babel-polyfill being required + // This adds > 6 seconds to the tests! Only orta should be forced into that. + if (process.env["USER"] === "orta") { + it("can execute async/await scheduled functions", async () => { + // this test takes *forever* because of babel-polyfill being required + const context = await setupDangerfileContext() + const runtime = await createDangerfileRuntimeEnvironment(context) + const results = await runDangerfileEnvironment(resolve(fixtures, "__DangerfileAsync.js"), runtime) + expect(results.warnings).toEqual([{ + message: "Async Function" + }, { + message: "After Async Function" + }]) + }) + } + + it("can schedule callback-based promised", async () => { const context = await setupDangerfileContext() const runtime = await createDangerfileRuntimeEnvironment(context) - const results = await runDangerfileEnvironment(resolve(fixtures, "__DangerfileAsync.js"), runtime) + const results = await runDangerfileEnvironment(resolve(fixtures, "__DangerfileCallback.js"), runtime) expect(results.warnings).toEqual([{ - message: "Async Function" - }, { - message: "After Async Function" + message: "Scheduled a callback", }]) }) - } - it("can schedule callback-based promised", async () => { - const context = await setupDangerfileContext() - const runtime = await createDangerfileRuntimeEnvironment(context) - const results = await runDangerfileEnvironment(resolve(fixtures, "__DangerfileCallback.js"), runtime) - expect(results.warnings).toEqual([{ - message: "Scheduled a callback", - }]) - }) + it("can handle TypeScript based Dangerfiles", async () => { + const context = await setupDangerfileContext() + const runtime = await createDangerfileRuntimeEnvironment(context) + const results = await runDangerfileEnvironment(resolve(fixtures, "__DangerfileTypeScript.ts"), runtime) + expect(results.messages).toEqual([{ + message: "Honey, we got Types", + }]) + }) - it("can handle TypeScript based Dangerfiles", async () => { - const context = await setupDangerfileContext() - const runtime = await createDangerfileRuntimeEnvironment(context) - const results = await runDangerfileEnvironment(resolve(fixtures, "__DangerfileTypeScript.ts"), runtime) - expect(results.messages).toEqual([{ - message: "Honey, we got Types", - }]) }) -}) - -describe("cleaning Dangerfiles", () => { - it("Supports removing the danger import", () => { - const path = resolve(os.tmpdir(), "fake_dangerfile_1") - fs.writeFileSync(path, "import { danger, warn, fail, message } from 'danger'") - updateDangerfile(path) - expect(fs.readFileSync(path).toString()).toEqual("// Removed import") - }) + describe("cleaning Dangerfiles", () => { + it("Supports removing the danger import", () => { + const path = resolve(os.tmpdir(), "fake_dangerfile_1") + fs.writeFileSync(path, "import { danger, warn, fail, message } from 'danger'") + updateDangerfile(path) + expect(fs.readFileSync(path).toString()).toEqual("// Removed import") + }) - it("also handles typescript style imports", () => { - const before = ` + it("also handles typescript style imports", () => { + const before = ` import { danger, warn, fail, message } from 'danger' import { danger, warn, fail, message } from "danger" import { danger, warn, fail, message } from "danger"; import danger from "danger" import danger from 'danger' import danger from 'danger'; -` - const after = ` + ` + const after = ` // Removed import // Removed import // Removed import // Removed import // Removed import // Removed import -` - expect(cleanDangerfile(before)).toEqual(after) - }) + ` + expect(cleanDangerfile(before)).toEqual(after) + }) - it("also handles require style imports", () => { - const before = ` + it("also handles require style imports", () => { + const before = ` const { danger, warn, fail, message } = require('danger') var { danger, warn, fail, message } = require("danger") let { danger, warn, fail, message } = require('danger'); -` - const after = ` + ` + const after = ` // Removed require // Removed require // Removed require -` - expect(cleanDangerfile(before)).toEqual(after) - }) -}) - -it("creates a working jest config", async () => { - const config = await dangerJestConfig() - // OK, this is almost perfect, but well, everyone has different paths. - // So we'll amend the ones that should be different per developer/CI - config.cacheDirectory = "[cache]" - config.testPathDirs = ["[testPathDirs]"] - config.testPathIgnorePatterns = ["[testPathIgnorePatterns]"] - - const cwd = process.cwd() - config.transform = config.transform.map(([files, transformer]) => { - const trans = transformer.includes("ts-jest") ? "[ts-jest-transformer]" : transformer - return [files, trans] + ` + expect(cleanDangerfile(before)).toEqual(after) + }) }) - expect(config).toMatchSnapshot() -}) + it("creates a working jest config", async () => { + const config = await dangerJestConfig() + // OK, this is almost perfect, but well, everyone has different paths. + // So we'll amend the ones that should be different per developer/CI + config.cacheDirectory = "[cache]" + config.testPathDirs = ["[testPathDirs]"] + config.testPathIgnorePatterns = ["[testPathIgnorePatterns]"] + + const cwd = process.cwd() + config.transform = config.transform.map(([files, transformer]) => { + const trans = transformer.includes("ts-jest") ? "[ts-jest-transformer]" : transformer + return [files, trans] + }) + + expect(config).toMatchSnapshot() + }) +) diff --git a/source/runner/_tests/__snapshots__/DangerRunner.test.ts.snap b/source/runner/_tests/__snapshots__/DangerRunner.test.ts.snap index 5724b5db0..29638dc75 100644 --- a/source/runner/_tests/__snapshots__/DangerRunner.test.ts.snap +++ b/source/runner/_tests/__snapshots__/DangerRunner.test.ts.snap @@ -21,6 +21,7 @@ Object { "moduleNameMapper": Array [], "name": "danger", "setupFiles": Array [], + "testEnvironment": "node", "testPathDirs": Array [ "[testPathDirs]", ], From 5eef02dc15f9d9a315c4d0d4a615f0c863aeca91 Mon Sep 17 00:00:00 2001 From: Orta Therox Date: Thu, 30 Mar 2017 09:19:28 +0100 Subject: [PATCH 12/12] Windows fixes --- source/runner/_tests/DangerRunner.test.ts | 76 +++++++++++------------ 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/source/runner/_tests/DangerRunner.test.ts b/source/runner/_tests/DangerRunner.test.ts index ad6b24585..8d5788ff6 100644 --- a/source/runner/_tests/DangerRunner.test.ts +++ b/source/runner/_tests/DangerRunner.test.ts @@ -143,64 +143,64 @@ if (process.platform !== "win32") { }) }) +} - describe("cleaning Dangerfiles", () => { - it("Supports removing the danger import", () => { - const path = resolve(os.tmpdir(), "fake_dangerfile_1") - fs.writeFileSync(path, "import { danger, warn, fail, message } from 'danger'") - updateDangerfile(path) - expect(fs.readFileSync(path).toString()).toEqual("// Removed import") - }) +describe("cleaning Dangerfiles", () => { + it("Supports removing the danger import", () => { + const path = resolve(os.tmpdir(), "fake_dangerfile_1") + fs.writeFileSync(path, "import { danger, warn, fail, message } from 'danger'") + updateDangerfile(path) + expect(fs.readFileSync(path).toString()).toEqual("// Removed import") + }) - it("also handles typescript style imports", () => { - const before = ` + it("also handles typescript style imports", () => { + const before = ` import { danger, warn, fail, message } from 'danger' import { danger, warn, fail, message } from "danger" import { danger, warn, fail, message } from "danger"; import danger from "danger" import danger from 'danger' import danger from 'danger'; - ` - const after = ` +` + const after = ` // Removed import // Removed import // Removed import // Removed import // Removed import // Removed import - ` - expect(cleanDangerfile(before)).toEqual(after) - }) +` + expect(cleanDangerfile(before)).toEqual(after) + }) - it("also handles require style imports", () => { - const before = ` + it("also handles require style imports", () => { + const before = ` const { danger, warn, fail, message } = require('danger') var { danger, warn, fail, message } = require("danger") let { danger, warn, fail, message } = require('danger'); - ` - const after = ` +` + const after = ` // Removed require // Removed require // Removed require - ` - expect(cleanDangerfile(before)).toEqual(after) - }) +` + expect(cleanDangerfile(before)).toEqual(after) }) - - it("creates a working jest config", async () => { - const config = await dangerJestConfig() - // OK, this is almost perfect, but well, everyone has different paths. - // So we'll amend the ones that should be different per developer/CI - config.cacheDirectory = "[cache]" - config.testPathDirs = ["[testPathDirs]"] - config.testPathIgnorePatterns = ["[testPathIgnorePatterns]"] - - const cwd = process.cwd() - config.transform = config.transform.map(([files, transformer]) => { - const trans = transformer.includes("ts-jest") ? "[ts-jest-transformer]" : transformer - return [files, trans] - }) - - expect(config).toMatchSnapshot() +}) + +it("creates a working jest config", async () => { + const config = await dangerJestConfig() + // OK, this is almost perfect, but well, everyone has different paths. + // So we'll amend the ones that should be different per developer/CI + config.cacheDirectory = "[cache]" + config.testPathDirs = ["[testPathDirs]"] + config.testPathIgnorePatterns = ["[testPathIgnorePatterns]"] + + const cwd = process.cwd() + config.transform = config.transform.map(([files, transformer]) => { + const trans = transformer.includes("ts-jest") ? "[ts-jest-transformer]" : transformer + return [files, trans] }) -) + + expect(config).toMatchSnapshot() +})