Skip to content

Commit

Permalink
Update Jest types, add a test to each CI to ensure it gets pulled out…
Browse files Browse the repository at this point in the history
… of the chooser
  • Loading branch information
orta committed Jan 30, 2017
1 parent 3b65c32 commit 563500f
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 6 deletions.
4 changes: 2 additions & 2 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

// Add your own contribution below

### 0.11.0
### 0.11.0 - 0.11.2

* Add support for [Docker Cloud](https://cloud.docker.com)
* Add support for [Docker Cloud](https://cloud.docker.com) - camacho

### 0.10.1

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"@types/commander": "^2.3.31",
"@types/debug": "0.0.29",
"@types/es6-promise": "0.0.32",
"@types/jest": "^18.0.0",
"@types/jest": "^18.1.0",
"@types/node-fetch": "^1.6.6",
"babel-cli": "^6.16.0",
"babel-plugin-syntax-async-functions": "^6.13.0",
Expand Down
Empty file.
8 changes: 8 additions & 0 deletions source/ci_source/providers/_tests/_circle.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {Circle} from "../Circle"
import {getCISourceForEnv} from "../../get_ci_source"

const correctEnv = {
"CIRCLE_CI_API_TOKEN": "xxx",
Expand All @@ -9,6 +10,13 @@ const correctEnv = {
"CI_PULL_REQUEST": "https://github.com/artsy/eigen/pull/800"
}

describe("being found when looking for CI", () => {
it("finds Circle with the right ENV", () => {
const ci = getCISourceForEnv(correctEnv)
expect(ci).toBeInstanceOf(Circle)
})
})

describe(".isCI", () => {
it("validates when all Circle environment vars are set", () => {
const circle = new Circle(correctEnv)
Expand Down
8 changes: 8 additions & 0 deletions source/ci_source/providers/_tests/_dockerCloud.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
import {DockerCloud} from "../DockerCloud"
import {getCISourceForEnv} from "../../get_ci_source"

const correctEnv = {
"DOCKER_REPO": "someproject",
"PULL_REQUEST_URL": "https://github.com/artsy/eigen/pull/800",
"SOURCE_REPOSITORY_URL": "https://github.com/artsy/eigen"
}

describe("being found when looking for CI", () => {
it("finds DockerCloud with the right ENV", () => {
const ci = getCISourceForEnv(correctEnv)
expect(ci).toBeInstanceOf(DockerCloud)
})
})

describe(".isCI", () => {
it("validates when all DockerCloud environment vars are set", () => {
const dockerCloud = new DockerCloud(correctEnv)
Expand Down
8 changes: 8 additions & 0 deletions source/ci_source/providers/_tests/_jenkins.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
import {Jenkins} from "../Jenkins"
import {getCISourceForEnv} from "../../get_ci_source"

const correctEnv = {
"ghprbGhRepository": "danger/danger-js",
"ghprbPullId": "50",
"JENKINS_URL": "https://danger.jenkins"
}

describe("being found when looking for CI", () => {
it("finds Jenkins with the right ENV", () => {
const ci = getCISourceForEnv(correctEnv)
expect(ci).toBeInstanceOf(Jenkins)
})
})

describe(".isCI", () => {
it("validates when JENKINS_URL is present in environment", () => {
const jenkins = new Jenkins(correctEnv)
Expand Down
8 changes: 8 additions & 0 deletions source/ci_source/providers/_tests/_semaphore.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
import {Semaphore} from "../Semaphore"
import {getCISourceForEnv} from "../../get_ci_source"

const correctEnv = {
"SEMAPHORE": "Yep",
"SEMAPHORE_REPO_SLUG": "artsy/eigen",
"PULL_REQUEST_NUMBER": "800"
}

describe("being found when looking for CI", () => {
it("finds Semaphore with the right ENV", () => {
const ci = getCISourceForEnv(correctEnv)
expect(ci).toBeInstanceOf(Semaphore)
})
})

describe(".isCI", () => {
test("validates when all Semaphore environment vars are set", () => {
const semaphore = new Semaphore(correctEnv)
Expand Down
8 changes: 8 additions & 0 deletions source/ci_source/providers/_tests/_travis.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
import {Travis} from "../Travis"
import {getCISourceForEnv} from "../../get_ci_source"

const correctEnv = {
"HAS_JOSH_K_SEAL_OF_APPROVAL": "true",
"TRAVIS_PULL_REQUEST": "800",
"TRAVIS_REPO_SLUG": "artsy/eigen"
}

describe("being found when looking for CI", () => {
it("finds Travis with the right ENV", () => {
const ci = getCISourceForEnv(correctEnv)
expect(ci).toBeInstanceOf(Travis)
})
})

describe(".isCI", () => {
test("validates when all Travis environment vars are set and Josh K says so", () => {
const travis = new Travis(correctEnv)
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
version "0.0.32"
resolved "https://registry.yarnpkg.com/@types/es6-promise/-/es6-promise-0.0.32.tgz#3bcf44fb1e429f3df76188c8c6d874463ba371fd"

"@types/jest@^18.0.0":
version "18.0.0"
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-18.0.0.tgz#c0cfc76c426b4ef5cdad464870cd9b4b081eea29"
"@types/jest@^18.1.0":
version "18.1.0"
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-18.1.0.tgz#ed18f4c75b3d76de966f543fb6e3bad77d3caa17"

"@types/node-fetch@^1.6.6":
version "1.6.7"
Expand Down

0 comments on commit 563500f

Please sign in to comment.