Skip to content

Commit 68466e1

Browse files
committed
+ Update testing case.
1 parent 7f00e58 commit 68466e1

File tree

3 files changed

+23
-7
lines changed

3 files changed

+23
-7
lines changed

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,11 @@
4242
"karma-chrome-launcher": "^2.0.0",
4343
"karma-coverage": "^1.1.1",
4444
"karma-mocha": "^1.2.0",
45-
"karma-phantomjs-launcher": "^1.0.2",
4645
"karma-sinon-chai": "^1.2.4",
4746
"karma-sourcemap-loader": "^0.3.7",
4847
"karma-spec-reporter": "0.0.26",
4948
"minifyify": "^7.3.4",
5049
"mocha": "^3.1.2",
51-
"phantomjs-prebuilt": "^2.1.13",
5250
"sinon": "^1.17.6",
5351
"sinon-chai": "^2.8.0",
5452
"vue": "^2.0.5",

test/karma.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const projectRoot = path.resolve(__dirname, '../')
44

55
module.exports = function (config) {
66
config.set({
7-
browsers: ['PhantomJS'],
7+
browsers: ['Chrome'],
88

99
browserNoActivityTimeout: 0,
1010

test/specs/vue-jsonp.spec.js

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Vue from 'vue'
2-
import VueJsonp from '../../'
2+
import VueJsonp from '../../dist/vue-jsonp.umd'
33

44
describe('VueJsonp testing.', function () {
55
this.timeout(5000)
@@ -10,7 +10,8 @@ describe('VueJsonp testing.', function () {
1010
})
1111

1212
it('Make a jsonp request.', function (done) {
13-
Vue.jsonp('http://live-api.bilibili.com/index/dynamic').then(result => {
13+
Vue.jsonp('http://api.live.bilibili.com/index/dynamic').then(result => {
14+
console.log(result)
1415
expect(result.code).equal(0)
1516
expect(result.msg).equal('ok')
1617
done()
@@ -20,10 +21,27 @@ describe('VueJsonp testing.', function () {
2021
})
2122

2223
it('Make a jsonp with custom querying and callback name.', function (done) {
23-
Vue.jsonp('http://live-api.bilibili.com/index/dynamic', {
24+
Vue.jsonp('http://api.live.bilibili.com/index/dynamic', {
2425
callbackQuery: 'callback',
25-
callbackName: 'func'
26+
callbackName: 'func',
27+
source: 'testing'
2628
}).then(result => {
29+
console.log(result)
30+
expect(result.code).equal(0)
31+
expect(result.msg).equal('ok')
32+
done()
33+
}, xhrObject => {
34+
done(xhrObject)
35+
})
36+
})
37+
38+
it('Make a jsonp with existing querying params in url.', function (done) {
39+
Vue.jsonp('http://api.live.bilibili.com/index/dynamic?name=LancerComet', {
40+
callbackQuery: 'callback',
41+
callbackName: 'func',
42+
source: 'testing'
43+
}).then(result => {
44+
console.log(result)
2745
expect(result.code).equal(0)
2846
expect(result.msg).equal('ok')
2947
done()

0 commit comments

Comments
 (0)