File tree Expand file tree Collapse file tree 6 files changed +55
-18
lines changed
Expand file tree Collapse file tree 6 files changed +55
-18
lines changed Original file line number Diff line number Diff line change 1717 "lint" : " eslint --fix packages/**/*.js packages/**/*.vue packages/**/bin/*" ,
1818 "prepublishOnly" : " conventional-changelog -p angular -r 2 -i CHANGELOG.md -s" ,
1919 "release" : " /bin/bash scripts/release.sh" ,
20- "test" : " node test/prepare.js && jest --config test/jest.config .js"
20+ "test" : " node scripts/ test.js"
2121 },
2222 "repository" : {
2323 "type" : " git" ,
5151 "eslint" : " ^4.19.1" ,
5252 "eslint-plugin-jest" : " ^21.15.1" ,
5353 "eslint-plugin-vue-libs" : " ^3.0.0" ,
54+ "execa" : " ^0.10.0" ,
5455 "jest" : " ^23.0.0" ,
5556 "jest-serializer-vue" : " ^1.0.0" ,
5657 "lerna" : " ^2.11.0" ,
5758 "lint-staged" : " ^7.0.4" ,
59+ "minimist" : " ^1.2.0" ,
5860 "vue-jest" : " ^2.6.0" ,
59- "vuepress-theme-vue" : " ^1.1.0" ,
6061 "yorkie" : " ^1.0.3"
6162 },
6263 "engines" : {
Original file line number Diff line number Diff line change 1+ test ( 'two plus two is four' , ( ) => {
2+ expect ( 2 + 2 ) . toBe ( 4 )
3+ } )
Original file line number Diff line number Diff line change 8888 "webpackbar" : " ^2.6.1" ,
8989 "workbox-build" : " ^3.1.0"
9090 },
91- "devDependencies" : {
92- "@vue/test-utils" : " ^1.0.0-beta.16" ,
93- "babel-core" : " ^7.0.0-0" ,
94- "babel-jest" : " ^23.0.0" ,
95- "conventional-changelog-cli" : " ^1.3.22" ,
96- "eslint" : " ^4.19.1" ,
97- "eslint-plugin-jest" : " ^21.15.1" ,
98- "eslint-plugin-vue-libs" : " ^3.0.0" ,
99- "jest" : " ^23.0.0" ,
100- "jest-serializer-vue" : " ^1.0.0" ,
101- "lint-staged" : " ^7.0.4" ,
102- "vue-jest" : " ^2.6.0" ,
103- "vuepress-theme-vue" : " ^1.1.0" ,
104- "yorkie" : " ^1.0.3"
105- },
10691 "engines" : {
10792 "node" : " >=8"
10893 },
Original file line number Diff line number Diff line change @@ -11,6 +11,10 @@ module.exports = {
1111 'js' ,
1212 'vue'
1313 ] ,
14+ testPathIgnorePatterns : [
15+ 'test.js' ,
16+ path . resolve ( __dirname , '../test' )
17+ ] ,
1418 moduleNameMapper : {
1519 '^@/(.*)$' : '<rootDir>/lib/$1'
1620 } ,
Original file line number Diff line number Diff line change 1+ const execa = require ( 'execa' )
2+ const minimist = require ( 'minimist' )
3+
4+ const rawArgs = process . argv . slice ( 2 )
5+ const args = minimist ( rawArgs )
6+
7+ let regex
8+ if ( args . p ) {
9+ const packages = ( args . p || args . package ) . split ( ',' ) . join ( '|' )
10+ regex = `.*@vuepress/(${ packages } |plugin-(${ packages } ))/.*\\.spec\\.js$`
11+ const i = rawArgs . indexOf ( '-p' )
12+ rawArgs . splice ( i , 2 )
13+ }
14+
15+ console . log ( regex )
16+
17+ ; ( async ( ) => {
18+ const jestArgs = [
19+ '--env' , 'node' ,
20+ '--config' , 'scripts/jest.config.js' ,
21+ '--runInBand' ,
22+ ...rawArgs ,
23+ ...( regex ? [ regex ] : [ ] )
24+ ]
25+ console . log ( `running jest with args: ${ jestArgs . join ( ' ' ) } ` )
26+ await execa ( 'jest' , jestArgs , {
27+ stdio : 'inherit'
28+ } )
29+ } ) ( ) . catch ( err => {
30+ err
31+ process . exit ( 1 )
32+ } )
Original file line number Diff line number Diff line change @@ -2491,7 +2491,7 @@ cross-spawn@^5.0.1, cross-spawn@^5.1.0:
24912491 shebang-command "^1.2.0"
24922492 which "^1.2.9"
24932493
2494- cross-spawn@^6.0.5 :
2494+ cross-spawn@^6.0.0, cross-spawn@^6.0. 5 :
24952495 version "6.0.5"
24962496 resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4"
24972497 dependencies :
@@ -3251,6 +3251,18 @@ exec-sh@^0.2.0:
32513251 dependencies :
32523252 merge "^1.2.0"
32533253
3254+ execa@^0.10.0 :
3255+ version "0.10.0"
3256+ resolved "https://registry.yarnpkg.com/execa/-/execa-0.10.0.tgz#ff456a8f53f90f8eccc71a96d11bdfc7f082cb50"
3257+ dependencies :
3258+ cross-spawn "^6.0.0"
3259+ get-stream "^3.0.0"
3260+ is-stream "^1.1.0"
3261+ npm-run-path "^2.0.0"
3262+ p-finally "^1.0.0"
3263+ signal-exit "^3.0.0"
3264+ strip-eof "^1.0.0"
3265+
32543266execa@^0.7.0 :
32553267 version "0.7.0"
32563268 resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777"
You can’t perform that action at this time.
0 commit comments