mercredi 1 novembre 2017

Karma test post or get of axios accrue 'Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL. '

This is my test.spec.js

describe('login', () => { let originalTimeout beforeEach(() => { originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL window.jasmine.DEFAULT_TIMEOUT_INTERVAL = 100 }) it('验证码', done => { setTimeout(() => { axios.get('http://api.github.com').then((response) => { expect(response.data).to.be.an('object') done() }) }, 1000) }) afterEach(() => { window.jasmine.DEFAULT_TIMEOUT_INTERVAL = originalTimeout })


It always accrue the error like this(anybody who can tell me why?):

This is the error.

Aucun commentaire:

Enregistrer un commentaire