Skip to content

Commit

Permalink
Move to es6, setup mocha and fix tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
adamrights committed Aug 7, 2015
1 parent 7e47fd2 commit 4e35ef4
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 41 deletions.
46 changes: 24 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Slideshow Component for React.js",
"main": "lib/PictureShow.js",
"scripts": {
"test": "mocha -r should -r test/util/test-helper.js --compilers jsx:test/util/compiler.js test/*.jsx",
"test": "mocha --compilers js:babel/register test/PictureShow.test.jsx",
"test-watch": "mocha -G -w -R min -r should -r test/util/test-helper.js --compilers jsx:test/util/compiler.js test/*.jsx",
"build:css": "node-sass src/PictureShow.scss lib/PictureShow.css",
"build:js": "jsx --no-cache-dir -x jsx ./src ./lib",
Expand All @@ -13,7 +13,7 @@
},
"repository": {
"type": "git",
"url": "https://github.com/areusjs/react-picture-show.git"
"url": "https://github.com/dowjones/react-picture-show.git"
},
"keywords": [
"react-component",
Expand All @@ -27,40 +27,42 @@
},
"homepage": "https://github.com/dowjones/react-picture-show",
"devDependencies": {
"jsdom": "3.1.2",
"mocha": "^2.1.0",
"react-tools": "^0.12.2",
"should": "^5.0.1",
"sinon": "^1.12.2",
"node-sass": "^0.5.0",
"proxyquire": "^1.3.2",
"b": "^2.0.1",
"babel": "^5.8.21",
"babel-eslint": "^4.0.5",
"babel-jest": "^5.3.0",
"balanced-match": "^0.2.0",
"browserify": "^8.1.3",
"common-errors": "^0.4.18",
"compression": "^1.4.1",
"connect-cache-control": "^1.0.0",
"express": "^4.11.2",
"gulp": "^3.8.11",
"gulp-buffer": "0.0.2",
"gulp-livereload": "^3.7.0",
"gulp-nodemon": "^1.0.5",
"gulp-rev": "^3.0.1",
"gulp-sass": "^1.3.3",
"gulp-uglify": "^1.1.0",
"gulp-util": "^3.0.3",
"gulp-livereload": "^3.7.0",
"is-frontend": "^1.0.0",
"jsdom": "^3.1.2",
"mocha": "^2.1.0",
"morgan": "^1.5.1",
"node-jsx": "^0.13.3",
"node-sass": "^0.5.0",
"proxyquire": "^1.3.2",
"reactify": "^1.0.0",
"rimraf": "^2.2.8",
"serve-static": "^1.8.1",
"should": "^5.0.1",
"sinon": "^1.15.4",
"vinyl-source-stream": "^1.0.0",
"watchify": "^2.3.0",
"common-errors": "^0.4.18",
"compression": "^1.4.1",
"connect-cache-control": "^1.0.0",
"express": "^4.11.2",
"morgan": "^1.5.1",
"node-jsx": "^0.12.4",
"react": "^0.13.3",
"serve-static": "^1.8.1"
},
"peerDependencies": {
"react": ">=0.12.1"
"watchify": "^2.3.0"
},
"dependencies": {
"lodash": "^3.3.1",
"react": "^0.13.3",
"react-swipeable": "^2.0.0"
}
}
4 changes: 2 additions & 2 deletions src/PictureShow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ module.exports = PictureShow = React.createClass({
direction: direction,
panels: panels,
trickPanel: trickPanel,
animationTime: animationTime,
animationTime: animationTime
});

},
Expand Down Expand Up @@ -271,7 +271,7 @@ module.exports = PictureShow = React.createClass({
var slides = [];

React.Children.forEach(this.props.children, function (slide, idx) {

var isPending = !this._shouldLoad(idx),
slideContent;

Expand Down
20 changes: 14 additions & 6 deletions test/PictureShow.test.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
import {jsdom} from "jsdom";

var PictureShow = require('../src/PictureShow.jsx'),
sinon = require('sinon'),
React = require('react'),
assert = require('should'),
TestUtils = require('react/addons/TestUtils');
global.document = jsdom("<!doctype html><html><body></body></html>");
global.window = document.defaultView;
global.navigator = window.navigator;

var slideshowElm, PictureShow;
import React from "react/addons";
let TestUtils = React.addons.TestUtils;

var sinon = require('sinon'),
assert = require('should');

let slideshowElm, PictureShow;


PictureShow = require('../src/PictureShow.jsx');

function setUp () {
slideshowElm = (
Expand Down
11 changes: 0 additions & 11 deletions test/util/compiler.js

This file was deleted.

0 comments on commit 4e35ef4

Please sign in to comment.