Skip to content

Commit

Permalink
Get all them testing and es6 ducks lined up
Browse files Browse the repository at this point in the history
  • Loading branch information
orta committed Oct 1, 2016
1 parent f8fee6c commit 43ebd10
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"presets": [
"es2016"
"es2015"
],
"plugins": ["transform-flow-strip-types"]
}
1 change: 1 addition & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ interfaces/
flow-typed/

[options]
unsafe.enable_getters_and_setters=true
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
},
"scripts": {
"test": "jest",
"watch": "jest --watch",
"flow": "flow; test $? -eq 0 -o $? -eq 2",
"lint": "eslint ./source",
"fixlint": "eslint ./source --fix",
Expand All @@ -33,7 +34,7 @@
"babel-eslint": "^7.0.0",
"babel-plugin-transform-flow-strip-types": "^6.8.0",
"babel-polyfill": "^6.13.0",
"babel-preset-es2016": "^6.11.3",
"babel-preset-es2015": "^6.16.0",
"eslint": "^3.3.1",
"eslint-config-standard": "^6.0.0-beta.3",
"eslint-plugin-flow-vars": "^0.5.0",
Expand Down
17 changes: 12 additions & 5 deletions source/ci_source/_tests/_travis.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import Travis from "../travis.js"

test("adds 1 + 2 to equal 3", () => {
// import { Travis } from "../travis.js"
let Travis = require("../travis.js")
let travis = new Travis({thing: ""})
expect(travis.env).toBe({thing: ""})
let correctEnv = {
"HAS_JOSH_K_SEAL_OF_APPROVAL": "true",
"TRAVIS_PULL_REQUEST": "800",
"TRAVIS_REPO_SLUG": "artsy/eigen"
}

describe(".validates_as_ci?", () => {
test("validates when all Travis environment vars are set and Josh K says so", () => {
let travis = new Travis(correctEnv)
expect(travis.isCI).toBeTruthy()
})
})
11 changes: 6 additions & 5 deletions source/ci_source/travis.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
"use strict"

export default class Travis {
env = []
env: any
constructor (env: any) { this.env = env }

isCI (env: any) : boolean {
return true
get isCI () : boolean {
return this.env.HAS_JOSH_K_SEAL_OF_APPROVAL != null
}
isPR (env: any) : boolean {
return true

get isPR () : boolean {
return this.env.HAS_JOSH_K_SEAL_OF_APPROVAL != null
}
}

0 comments on commit 43ebd10

Please sign in to comment.