testing suite established
This commit is contained in:
17
__tests__/components/MainList.react.jest.js
Normal file
17
__tests__/components/MainList.react.jest.js
Normal 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);
|
||||||
|
});
|
||||||
|
});
|
||||||
17
__tests__/components/Navbar.react.jest.js
Normal file
17
__tests__/components/Navbar.react.jest.js
Normal 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);
|
||||||
|
});
|
||||||
|
});
|
||||||
17
__tests__/components/Wakatime.react.jest.js
Normal file
17
__tests__/components/Wakatime.react.jest.js
Normal 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);
|
||||||
|
});
|
||||||
|
});
|
||||||
10
__tests__/helpers/changeExtensionIcon.spec.js
Normal file
10
__tests__/helpers/changeExtensionIcon.spec.js
Normal 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');
|
||||||
|
});
|
||||||
|
});
|
||||||
10
__tests__/helpers/currentTimestamp.spec.js
Normal file
10
__tests__/helpers/currentTimestamp.spec.js
Normal 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');
|
||||||
|
});
|
||||||
|
});
|
||||||
9
__tests__/preprocessor.js
Normal file
9
__tests__/preprocessor.js
Normal 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));
|
||||||
|
}
|
||||||
|
};
|
||||||
21
package.json
21
package.json
@@ -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,
|
"private": true,
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"babel": "^5.5.6",
|
||||||
"gulp": "^3.8.8",
|
"gulp": "^3.8.8",
|
||||||
"laravel-elixir": "*"
|
"laravel-elixir": "*",
|
||||||
|
"mocha": "^2.2.5",
|
||||||
|
"mocha-sinon": "^1.1.4",
|
||||||
|
"sinon": "^1.14.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bootstrap": "^3.3.4",
|
"bootstrap": "^3.3.4",
|
||||||
"jquery": "^2.1.3",
|
"jquery": "^2.1.3",
|
||||||
"react": "^0.13.1"
|
"react": "^0.13.3",
|
||||||
|
"react-tools": "^0.13.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user