Skip to content

Commit

Permalink
test enzyme in the browser with tape
Browse files Browse the repository at this point in the history
  • Loading branch information
marr committed Jan 26, 2016
1 parent a514435 commit 18d9273
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"scripts": {
"clean": "rm -rf dist",
"build": "babel src --out-dir=dist",
"test": "babel-node test/**/*.js | faucet"
"test": "babel-node test/index.js",
"test:browser": "browserify -i 'react/lib/ReactContext' -i 'react/lib/ExecutionEnvironment' -t babelify test/index.js | browser-run -p 2222 | tap-spec",
"test:spec": "npm run test | tap-spec"
},
"keywords": [],
"author": "",
Expand All @@ -16,15 +18,16 @@
"babel-preset-react": "^6.3.13",
"babelify": "^7.2.0",
"blue-tape": "^0.1.11",
"browser-run": "^3.0.6",
"browserify": "^13.0.0",
"chai": "^3.4.1",
"chai-enzyme": "^0.2.2",
"enzyme": "^1.4.0",
"faucet": "0.0.1",
"jsdom": "^7.2.2",
"mocha": "^2.3.4",
"react": "^0.14.6",
"react-addons-test-utils": "^0.14.6",
"react-dom": "^0.14.6"
"react-dom": "^0.14.6",
"tap-spec": "^4.1.1"
}
}
11 changes: 9 additions & 2 deletions test/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import test from 'tape'
// import domUtil from './utils/dom'
// import enzymeUtil from './utils/enzyme'
import {shallow} from 'enzyme'
import React from 'react'

Expand All @@ -9,6 +7,15 @@ test("basic arithmetic", assert => {
assert.equal(1 + 1, 2)
})

test("client vs server", assert => {
if (!process.env.npm_lifecycle_event) {
assert.ok(process.browser)
} else {
assert.pass('No client')
}
assert.end()
})

const Fixture = props => <div>{props.content}</div>

test("react renderer", assert => {
Expand Down

0 comments on commit 18d9273

Please sign in to comment.