Skip to content

Commit

Permalink
test: add e2e case (#548)
Browse files Browse the repository at this point in the history
* test: add e2e case

* chore: tsconfig add e2e file exclude

Co-authored-by: 谢仁洪 <xierenhong@renrenche.com>
  • Loading branch information
2 people authored and sorrycc committed Jun 23, 2022
1 parent 0980446 commit 4187943
Show file tree
Hide file tree
Showing 17 changed files with 917 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,8 @@
*.tsbuildinfo
.jest-cache
.swc
/test/**/fixtures/*/dist
/test/**/fixtures/*/.umi
/test/**/fixtures/*/.umi-production
/test/**/fixtures/*/src/.umi
/test/**/fixtures/*/src/.umi-production
16 changes: 16 additions & 0 deletions jest.e2e.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Config, createConfig } from 'umi/test';

export default {
...createConfig(),
preset: 'jest-playwright-preset',
setupFilesAfterEnv: ['expect-playwright'],
testMatch: ['**/*.e2e.ts'],
modulePathIgnorePatterns: [
'<rootDir>/packages/.+/compiled',
'<rootDir>/packages/.+/fixtures',
'<rootDir>/test/.+/fixtures',
],
moduleNameMapper: {
'test-utils': '<rootDir>/test/lib/testUtils.ts',
},
} as Config.InitialOptions;
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"setup:webstorm": "esno scripts/setupWebStorm.ts",
"test": "esno scripts/turbo.ts --cmd test --parallel",
"test:clean": "esno scripts/turbo.ts --cmd test --no-cache --parallel -- --clearCache",
"test:e2e": "jest --config jest.e2e.config.ts",
"tsc:check": "tsc --noEmit",
"turbo:clean": "rimraf .turbo"
},
Expand Down Expand Up @@ -50,13 +51,16 @@
"@vercel/ncc": "0.33.3",
"dts-packer": "^0.0.3",
"esno": "^0.14.1",
"expect-playwright": "^0.8.0",
"git-repo-info": "^2.1.1",
"husky": "^7.0.4",
"jest": "^27.5.1",
"jest-playwright-preset": "^1.7.0",
"lerna": "^4.0.0",
"lint-staged": "^12.3.7",
"matcher": "^5.0.0",
"only-allow": "^1.1.0",
"playwright-chromium": "^1.20.1",
"prettier": "^2.6.0",
"prettier-plugin-organize-imports": "^2.3.4",
"prettier-plugin-packagejson": "^2.2.16",
Expand Down
Loading

0 comments on commit 4187943

Please sign in to comment.