Skip to content

Commit

Permalink
Update deps & move tests to babel 6.
Browse files Browse the repository at this point in the history
  • Loading branch information
STRML committed Jun 16, 2016
1 parent 6bf1abd commit 6f084e0
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"stage": 0,
"presets": ["react", "es2015"],
"env": {
"test": {
"plugins": [
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ test: test-unit test-server
@echo "The browser test suite should be run before commit. Run 'make test-local' to run it."

test-unit:
@env NODE_ENV=test ./node_modules/.bin/mocha -R spec --compilers js:babel/register -b tests/unit/*.js
@env NODE_ENV=test ./node_modules/.bin/mocha -R spec --compilers js:babel-register -b tests/unit/*.js

test-server:
@env NODE_ENV=test ./node_modules/.bin/mocha -R spec --compilers js:babel/register -b tests/server/*.js
@env NODE_ENV=test ./node_modules/.bin/mocha -R spec --compilers js:babel-register -b tests/server/*.js

test-local:
@env NODE_ENV=test ./node_modules/.bin/babel -f tests/browser/browser-jsx.jsx tests/browser/browser-jsx.jsx -o tests/browser/browser-jsx.js
@env NODE_ENV=test ./node_modules/.bin/zuul --local 3000 -- tests/browser/*.js
@env NODE_ENV=test ./node_modules/.bin/zuul --local 3000 -- tests/browser/*.js

test-cloud:
@env NODE_ENV=test ./node_modules/.bin/zuul -- tests/browser/*.js
Expand Down
35 changes: 19 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,30 @@
"description": "Declarative router component for React",
"main": "index.js",
"dependencies": {
"object-assign": "^4.0.1",
"qs": "^5.2.0",
"url-pattern": "~0.10.2",
"object-assign": "^4.1.0",
"qs": "^6.2.0",
"url-pattern": "~1.0.1",
"urllite": "~0.5.0"
},
"devDependencies": {
"babel": "^5.8.23",
"babel-eslint": "^5.0.0-beta6",
"babel-plugin-espower": "^1.1.0",
"browserify": "^11.2.0",
"browserify-shim": "^3.8.10",
"babel": "^6.5.2",
"babel-cli": "^6.10.1",
"babel-eslint": "^6.0.4",
"babel-plugin-espower": "^2.2.0",
"babel-preset-es2015": "^6.9.0",
"babel-preset-react": "^6.5.0",
"browserify": "^13.0.1",
"browserify-shim": "^3.8.12",
"envify": "^3.4.0",
"eslint": "^1.6.0",
"eslint-plugin-react": "^3.5.1",
"eslint": "^2.12.0",
"eslint-plugin-react": "^5.1.1",
"jsxhint": "^0.15.1",
"mocha": "^2.3.3",
"power-assert": "^1.2.0",
"react": "^15.0.0",
"react-dom": "^15.0.0",
"mocha": "^2.5.3",
"power-assert": "^1.4.1",
"react": "^15.1.0",
"react-dom": "^15.1.0",
"semver": "^5.1.0",
"zuul": "^3.6.0"
"zuul": "^3.10.1"
},
"peerDependencies": {
"react": "^0.14.0 || ^15.0.0",
Expand Down Expand Up @@ -66,4 +69,4 @@
"publishConfig": {
"registry": "https://registry.npmjs.org"
}
}
}
11 changes: 8 additions & 3 deletions tests/browser/browser-jsx.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
'use strict';

var _powerAssertRecorder = function () { function PowerAssertRecorder() { this.captured = []; } PowerAssertRecorder.prototype._capt = function _capt(value, espath) { this.captured.push({ value: value, espath: espath }); return value; }; PowerAssertRecorder.prototype._expr = function _expr(value, source) { return { powerAssertContext: { value: value, events: this.captured }, source: source }; }; return PowerAssertRecorder; }();

var assert = require('power-assert');
var React = require('react');
var ReactDOM = require('react-dom');
Expand All @@ -25,11 +28,14 @@ function getRenderedContent() {
}

function assertRendered(text) {
assert.equal(assert._expr(assert._capt(getRenderedContent(), 'arguments/0'), {
var _rec = new _powerAssertRecorder(),
_rec2 = new _powerAssertRecorder();

assert.equal(_rec._expr(_rec._capt(getRenderedContent(), 'arguments/0'), {
content: 'assert.equal(getRenderedContent(), text)',
filepath: 'tests/browser/browser-jsx.jsx',
line: 31
}), assert._expr(assert._capt(text, 'arguments/1'), {
}), _rec2._expr(_rec2._capt(text, 'arguments/1'), {
content: 'assert.equal(getRenderedContent(), text)',
filepath: 'tests/browser/browser-jsx.jsx',
line: 31
Expand Down Expand Up @@ -131,4 +137,3 @@ describe('JSX + Routing with async components', function () {
});
});
});

0 comments on commit 6f084e0

Please sign in to comment.