Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
chenshuai2144 committed Jul 8, 2019
1 parent dbaeb33 commit d57228a
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/functions/mock/**
/scripts
/config
**/node_modules/**
_scripts
_scripts
/lambda/mock/**
_test_
15 changes: 9 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"scripts": {
"dev": "cross-env PAGES_PATH='ListBasicList/src' umi dev",
"dev": "cross-env PAGES_PATH='AccountCenter/src' umi dev",
"format-imports": "import-sort --write '**/*.{js,jsx,ts,tsx}'",
"lint": "npm run lint:js && npm run lint:style",
"lint-staged": "lint-staged",
Expand All @@ -11,7 +11,8 @@
"lint:style": "stylelint --fix '**/*.less' --syntax less",
"prettier": "prettier -c --write **/*",
"screenshot": "block-screenshot",
"start": "umi dev"
"start": "umi dev",
"test": "umi test"
},
"husky": {
"hooks": {
Expand All @@ -28,17 +29,19 @@
"**/*.{js,ts,tsx}": "npm run lint-staged:js"
},
"dependencies": {
"@ant-design/pro-layout": "^4.5.10",
"@types/react-dom": "^16.8.4",
"antd": "3.20.0",
"block-screenshot": "^1.0.0",
"block-screenshot": "^1.0.1",
"cross-env": "^5.2.0",
"numeral": "^2.0.6",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"umi": "^2.6.17",
"umi": "^2.8.9",
"umi-plugin-block-dev": "2.2.0-beta.0",
"umi-plugin-react": "^1.9.7",
"umi-request": "^1.0.0"
"umi-request": "^1.0.0",
"umi-utils": "^1.5.1"
},
"devDependencies": {
"@types/classnames": "^2.2.7",
Expand Down Expand Up @@ -67,4 +70,4 @@
"**/*.less",
"**/*.md"
]
}
}
15 changes: 15 additions & 0 deletions tests/__tests__/index.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const diffImage = require('block-screenshot/src/screenshot');
const path = require('path');
const { winPath } = require('umi-utils');

jest.setTimeout(50000000);
describe('Pro Block', () => {
it('🥩 diff all block images', async () => {
const diffFileList = await diffImage({
cwd: path.join(winPath(__dirname), '../../'),
diff: true,
});
expect(diffFileList).toBe(0);
});
});

0 comments on commit d57228a

Please sign in to comment.