basic test

This commit is contained in:
afc163 2015-11-02 22:36:21 +08:00
parent 9ef72bae9d
commit 2fa7f95cce
4 changed files with 15 additions and 21 deletions

View File

@ -73,7 +73,6 @@
"babel": "^5.8.29",
"babel-core": "^5.8.29",
"babel-eslint": "^4.1.0",
"babel-jest": "~5.3.0",
"babel-loader": "^5.3.2",
"busboy": "^0.2.9",
"chalk": "^1.1.0",
@ -93,9 +92,11 @@
"nico-jsx": "~0.6.0",
"precommit-hook": "^1.0.7",
"react": "0.14.0",
"react-addons-test-utils": "0.14.0",
"react-dom": "0.14.0",
"react-router": "1.0.0-rc3",
"webpack": "^1.10.1",
"webpack-babel-jest": "^1.0.0",
"webpack-dev-middleware": "^1.2.0"
},
"scripts": {
@ -106,13 +107,12 @@
"just-deploy": "npm run clean && webpack --config webpack.deploy.config.js && NODE_ENV=PRODUCTION nico build && node scripts/deploy.js",
"lint": "eslint components index.js --ext '.js,.jsx'",
"lesslint": "lesslint style",
"test": "BABEL_ENV=test BABEL_JEST_STAGE=2 jest",
"test": "npm run lint && webpack && jest",
"pub": "sh ./scripts/publish.sh",
"webpack": "webpack",
"beta": "sh ./scripts/publish.sh --tag beta"
},
"jest": {
"rootDir": ".",
"moduleFileExtensions": [
"js",
"jsx",
@ -121,7 +121,7 @@
"unmockedModulePathPatterns": [
"<rootDir>/node_modules/*"
],
"scriptPreprocessor": "<rootDir>/scripts/jest-script-preprocessor",
"scriptPreprocessor": "<rootDir>/node_modules/webpack-babel-jest",
"testDirectoryName": "tests"
},
"precommit": [

View File

@ -1,9 +0,0 @@
// jest-script-preprocessor.js
var babelJest = require("babel-jest");
module.exports = {
process: function(src, filename) {
return babelJest.process(src, filename)
.replace(/^require.*\.less.*;$/gm, '');
}
};

View File

@ -1,8 +0,0 @@
jest.dontMock('../index');
var antd = require('../index');
describe('antd', function() {
it('antd should be existd', function() {
expect(antd).toBeTruthy();
});
});

11
tests/index.test.js Normal file
View File

@ -0,0 +1,11 @@
jest.dontMock('../index');
import antd, {
Button,
} from '../index';
describe('antd', function() {
it('antd and components should be existd', function() {
expect(antd).toBeTruthy();
expect(Button).toBeTruthy();
});
});