Merge pull request #464 from ant-design/simple-test-via-jest

Simple test via jest
This commit is contained in:
偏右 2015-11-02 22:37:24 +08:00
commit 145a20ece1
2 changed files with 27 additions and 1 deletions

View File

@ -83,6 +83,7 @@
"eslint-plugin-react": "^3.3.1",
"extract-text-webpack-plugin": "^0.8.1",
"gh-pages": "^0.3.1",
"jest-cli": "~0.6.1",
"json-loader": "^0.5.1",
"less": "~2.5.1",
"less-loader": "^2.2.0",
@ -91,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": {
@ -104,11 +107,23 @@
"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": "npm run lint && webpack",
"test": "npm run lint && webpack && jest",
"pub": "sh ./scripts/publish.sh",
"webpack": "webpack",
"beta": "sh ./scripts/publish.sh --tag beta"
},
"jest": {
"moduleFileExtensions": [
"js",
"jsx",
"json"
],
"unmockedModulePathPatterns": [
"<rootDir>/node_modules/*"
],
"scriptPreprocessor": "<rootDir>/node_modules/webpack-babel-jest",
"testDirectoryName": "tests"
},
"precommit": [
"lint"
]

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();
});
});