testing suite established

This commit is contained in:
Stephen Rodriguez
2015-06-10 02:10:32 -04:00
parent 0b5bb07819
commit 137a3f61fa
7 changed files with 99 additions and 2 deletions

View File

@@ -0,0 +1,17 @@
jest.dontMock('../../assets/js/components/MainList.react.js');
describe('MainList', function() {
var React, MainList, TestUtils, Component;
beforeEach(function() {
// Setup our tools
React = require('react/addons');
MainList = require('../../assets/js/components/MainList.react.js');
TestUtils = React.addons.TestUtils;
// Create the React component here using TestUtils and store into Component
});
it('should work', function() {
expect(2 + 2).toEqual(4);
});
});

View File

@@ -0,0 +1,17 @@
jest.dontMock('../../assets/js/components/Navbar.react.js');
describe('Navbar', function() {
var React, Navbar, TestUtils, Component;
beforeEach(function() {
// Setup our tools
React = require('react/addons');
Navbar = require('../../assets/js/components/Navbar.react.js');
TestUtils = React.addons.TestUtils;
// Create the React component here using TestUtils and store into Component
});
it('should work', function() {
expect(2 + 2).toEqual(4);
});
});

View File

@@ -0,0 +1,17 @@
jest.dontMock('../../assets/js/components/Wakatime.react.js');
describe('Wakatime', function() {
var React, Wakatime, TestUtils, Component;
beforeEach(function() {
// Setup our tools
React = require('react/addons');
Wakatime = require('../../assets/js/components/Wakatime.react.js');
TestUtils = React.addons.TestUtils;
// Create the React component here using TestUtils and store into Component
});
it('should work', function() {
expect(2 + 2).toEqual(4);
});
});

View File

@@ -0,0 +1,10 @@
var chai = require('chai');
var expect = chai.expect;
import changeExtensionIcon from '../../assets/js/helpers/changeExtensionIcon';
describe('changeExtensionIcon', function() {
it('should be a function', function() {
expect(changeExtensionIcon).to.be.a('function');
});
});

View File

@@ -0,0 +1,10 @@
var chai = require('chai');
var expect = chai.expect;
import currentTimestamp from '../../assets/js/helpers/currentTimestamp';
describe('currentTimestamp', function() {
it('should be a function', function() {
expect(currentTimestamp).to.be.a('function');
});
});

View File

@@ -0,0 +1,9 @@
// preprocessor.js
var ReactTools = require('react-tools');
var to5 = require('6to5-jest').process;
module.exports = {
process: function(src, filename) {
return ReactTools.transform(to5(src, filename));
}
};

View File

@@ -1,12 +1,29 @@
{
"scripts": {
"test": "jest && mocha --compilers js:mocha-traceur __tests__/**/*.spec.js"
},
"jest": {
"testFileExtensions": [
"jest.js"
],
"scriptPreprocessor": "<rootDir>/__tests__/preprocessor.js",
"unmockedModulePathPatterns": [
"<rootDir>/node_modules/react"
]
},
"private": true,
"devDependencies": {
"babel": "^5.5.6",
"gulp": "^3.8.8",
"laravel-elixir": "*"
"laravel-elixir": "*",
"mocha": "^2.2.5",
"mocha-sinon": "^1.1.4",
"sinon": "^1.14.1"
},
"dependencies": {
"bootstrap": "^3.3.4",
"jquery": "^2.1.3",
"react": "^0.13.1"
"react": "^0.13.3",
"react-tools": "^0.13.3"
}
}