Skip to content
This repository has been archived by the owner on Mar 12, 2020. It is now read-only.

Commit

Permalink
Merge pull request #233 from artsy/testing
Browse files Browse the repository at this point in the history
Start looking at testing
  • Loading branch information
orta authored Aug 15, 2016
2 parents b31fed4 + bf9996f commit 61df1db
Show file tree
Hide file tree
Showing 21 changed files with 186 additions and 146 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,6 @@ Example/Pods
Example/compile_commands.json
Example/Emission/Configuration.h
.vscode/launchReactNative.js
.vscode/.react/
.vscode/.react/
typings

15 changes: 15 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
language: node_js
node_js:
- "6.1"

before_install:
- rvm install 2.2
- rvm use 2.2 --fuzzy

install:
- bundle install
- npm install

before_script:
- bundle exec danger
- npm run lint
1 change: 1 addition & 0 deletions Dangerfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
message("Hello, world.")
7 changes: 7 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Once danger-js is shipped, I'm happy to move this to a `gem install danger-js` step in travis if we want.
source "https://rubygems.org"

gem "danger", git: "https://github.com/danger/danger", :branch => "js"
gem "danger-js"

gem "danger-junit"
67 changes: 67 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
GIT
remote: https://github.com/danger/danger
revision: b5ceb81c029eee496f746b4039b2801d5cc4b9c0
branch: js
specs:
danger (2.1.2)
claide (~> 1.0)
claide-plugins (> 0.9.0)
colored (~> 1.2)
cork (~> 0.1)
faraday (~> 0)
faraday-http-cache (~> 1.0)
git (~> 1)
kramdown (~> 1.5)
octokit (~> 4.2)
terminal-table (~> 1)

GEM
remote: https://rubygems.org/
specs:
addressable (2.4.0)
claide (1.0.0)
claide-plugins (0.9.1)
cork
nap
open4 (~> 1.3)
colored (1.2)
cork (0.1.0)
colored (~> 1.2)
danger-js (1.0.0)
danger (> 2.0)
therubyracer (~> 0.12)
danger-junit (0.7.0)
danger (~> 2.0)
ox (~> 2.0)
faraday (0.9.2)
multipart-post (>= 1.2, < 3)
faraday-http-cache (1.3.1)
faraday (~> 0.8)
git (1.3.0)
kramdown (1.11.1)
libv8 (3.16.14.15)
multipart-post (2.0.0)
nap (1.1.0)
octokit (4.3.0)
sawyer (~> 0.7.0, >= 0.5.3)
open4 (1.3.4)
ox (2.4.4)
ref (2.0.0)
sawyer (0.7.0)
addressable (>= 2.3.5, < 2.5)
faraday (~> 0.8, < 0.10)
terminal-table (1.6.0)
therubyracer (0.12.2)
libv8 (~> 3.16.14.0)
ref

PLATFORMS
ruby

DEPENDENCIES
danger!
danger-js
danger-junit

BUNDLED WITH
1.12.5
6 changes: 5 additions & 1 deletion dependencyci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
platforms:
rubygems:
colored:
tests:
unmaintained: skip
NPM:
jade:
tests:
deprecated: skip
deprecated: skip
3 changes: 2 additions & 1 deletion jsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"exclude": [
"node_modules",
"Pod/Assets",
"Example/Build"
"Example/Build",
".vscode/typings"
]
}
14 changes: 14 additions & 0 deletions lib/components/__tests__/__snapshots__/seperator-tests.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
exports[`test looks like expected 1`] = `
<View
style={
Array [
Object {
"backgroundColor": "#e5e5e5",
"height": 1,
"marginLeft": -20,
"marginRight": -20
},
undefined
]
} />
`;
26 changes: 26 additions & 0 deletions lib/components/__tests__/__snapshots__/tab_view-tests.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
exports[`test looks like expected 1`] = `
<View>
<View
style={
Array [
Object {
"alignSelf": "flex-start",
"borderColor": "red",
"borderWidth": 1
},
Array [
Object {
"height": 46
},
Object {
"marginBottom": 30,
"marginLeft": 0,
"marginRight": 0,
"marginTop": 30
}
]
]
} />
<View />
</View>
`;
13 changes: 13 additions & 0 deletions lib/components/__tests__/seperator-tests.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import 'react-native'
import React from 'react'
import renderer from 'react-test-renderer'
import Separator from '..//separator'

it('looks like expected', () => {
const tree = renderer.create(
<Separator />
).toJSON()
expect(tree).toMatchSnapshot()
})


11 changes: 11 additions & 0 deletions lib/components/__tests__/tab_view-tests.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import 'react-native'
import React from 'react'
import renderer from 'react-test-renderer'
import TabView from '../tab_view'

it('looks like expected', () => {
const tree = renderer.create(
<TabView titles={['one', 'two']} selectedIndex={1} onSelectionChange={() => {}} />
).toJSON()
expect(tree).toMatchSnapshot()
})
23 changes: 13 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@
"sync-colors": "cd externals/elan && git fetch && git checkout origin/master && cp components/lib/variables/colors.json ../../data",
"sync-externals": "npm run-script sync-schema && npm run-script sync-colors",
"sync-schema": "cd externals/metaphysics && git fetch && git checkout origin/master && npm install && npm run dump-schema -- ../../data && rm -rf node_modules",
"test": "env NODE_ENV=test NODE_PATH=./lib mocha --recursive ./test"
"test": "jest",
"testing": "jest --watch"
},
"jest": {
"preset": "jest-react-native"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -49,22 +53,21 @@
"devDependencies": {
"@kadira/react-native-storybook": "^1.11.3",
"babel-eslint": "^6.0.0",
"babel-jest": "^14.1.0",
"babel-polyfill": "^6.13.0",
"babel-preset-react-native": "^1.9.0",
"babel-relay-plugin": "^0.9.0",
"chai": "^3.5.0",
"chai-as-promised": "^5.3.0",
"chai-enzyme": "^0.4.2",
"concurrently": "^2.2.0",
"enzyme": "^2.2.0",
"eslint": "^2.5.3",
"eslint-plugin-flow-vars": "^0.2.1",
"eslint-plugin-flowtype": "^2.3.1",
"eslint-plugin-react": "^4.2.1",
"flow-bin": "0.29.0",
"mocha": "^2.4.5",
"react-addons-test-utils": "^15.1.0",
"react-dom": "^15.1.0",
"jest": "^14.1.0",
"jest-cli": "^14.1.0",
"jest-react-native": "^14.1.2",
"react-storybooks-relay-container": "^1.0.0",
"sinon": "^1.17.3"
"react-test-renderer": "^15.3.0",
"typings": "^1.3.2"
},
"peerDependencies": {
"babel-relay-plugin": "^0.9.0"
Expand Down
13 changes: 0 additions & 13 deletions test/components/artist/header.test.js

This file was deleted.

16 changes: 0 additions & 16 deletions test/containers/artist.test.js

This file was deleted.

2 changes: 0 additions & 2 deletions test/mocha.opts

This file was deleted.

33 changes: 0 additions & 33 deletions test/sanity.test.js

This file was deleted.

14 changes: 0 additions & 14 deletions test/support/common.js

This file was deleted.

22 changes: 0 additions & 22 deletions test/support/compiler.js

This file was deleted.

32 changes: 0 additions & 32 deletions test/support/mocks/react-native.js

This file was deleted.

2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
"Pod/Assets",
"Example/Build"
]
}
}
8 changes: 8 additions & 0 deletions typings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"globalDependencies": {
"jasmine": "registry:dt/jasmine#2.2.0+20160621224255",
"lodash": "registry:dt/lodash#4.14.0+20160802150749",
"react": "registry:dt/react#0.14.0+20160805125551",
"react-native": "registry:dt/react-native#0.29.0+20160728152643"
}
}

0 comments on commit 61df1db

Please # to comment.