File tree Expand file tree Collapse file tree 3 files changed +13
-6
lines changed Expand file tree Collapse file tree 3 files changed +13
-6
lines changed Original file line number Diff line number Diff line change 1
1
module . exports = function ( config ) {
2
2
config . set ( {
3
- browsers : [ 'Chrome ' ] ,
3
+ browsers : [ 'PhantomJS ' ] ,
4
4
reporters : [ 'spec' , 'coverage' ] ,
5
5
frameworks : [ 'jasmine' ] ,
6
6
files : [ '../test/unit/specs/index.js' ] ,
Original file line number Diff line number Diff line change 40
40
"istanbul-instrumenter-loader" : " ^0.1.3" ,
41
41
"jasmine-core" : " ^2.3.2" ,
42
42
"karma" : " ^0.13.8" ,
43
- "karma-chrome-launcher" : " ^0.1.7" ,
44
43
"karma-coverage" : " ^0.2.7" ,
45
44
"karma-jasmine" : " ^0.3.5" ,
46
- "karma-sauce -launcher" : " ^0.2.10 " ,
45
+ "karma-phantomjs -launcher" : " ^0.2.1 " ,
47
46
"karma-spec-reporter" : " 0.0.20" ,
48
47
"karma-webpack" : " ^1.7.0" ,
49
48
"nightwatch" : " ^0.7.9" ,
49
+ "phantomjs" : " ^1.9.18" ,
50
50
"selenium-server" : " 2.47.1" ,
51
51
"style-loader" : " ^0.12.3" ,
52
52
"vue" : " yyx990803/vue#dev" ,
Original file line number Diff line number Diff line change @@ -159,14 +159,14 @@ describe('Core', function () {
159
159
expect ( el . textContent ) . toBe ( 'Link A' )
160
160
var link = el . querySelector ( '#link-a' )
161
161
expect ( link . getAttribute ( 'href' ) ) . toBe ( 'b' )
162
- link . click ( )
162
+ click ( link )
163
163
nextTick ( function ( ) {
164
164
expect ( el . textContent ) . toBe ( 'Link B' )
165
165
var link = el . querySelector ( '#link-b' )
166
166
expect ( link . getAttribute ( 'href' ) ) . toBe ( '/a' )
167
167
// falsy expressions should not set href
168
168
expect ( el . querySelector ( '#link-c' ) . hasAttribute ( 'href' ) ) . toBe ( false )
169
- link . click ( )
169
+ click ( link )
170
170
nextTick ( function ( ) {
171
171
expect ( el . textContent ) . toBe ( 'Link A' )
172
172
done ( )
@@ -244,7 +244,7 @@ describe('Core', function () {
244
244
router . start ( App , el )
245
245
router . go ( '/foo' )
246
246
nextTick ( function ( ) {
247
- router . app . $el . querySelector ( '#link' ) . click ( )
247
+ click ( router . app . $el . querySelector ( '#link' ) )
248
248
nextTick ( function ( ) {
249
249
var text = router . app . $el . textContent
250
250
expect ( text ) . toBe ( '1234' )
@@ -529,4 +529,11 @@ describe('Core', function () {
529
529
}
530
530
} )
531
531
}
532
+
533
+ function click ( target ) {
534
+ var e = document . createEvent ( 'HTMLEvents' )
535
+ e . initEvent ( 'click' , true , true )
536
+ e . button = 0
537
+ target . dispatchEvent ( e )
538
+ }
532
539
} )
You can’t perform that action at this time.
0 commit comments