зеркало из https://github.com/docker/kitematic.git
Properly set timeout for integration tests
This commit is contained in:
Родитель
5f32883e91
Коммит
0dc304b37b
|
@ -1,22 +1,24 @@
|
|||
jest.autoMockOff();
|
||||
|
||||
jasmine.getEnv().defaultTimeoutInterval = 60000;
|
||||
|
||||
let hubUtil = require('../src/utils/HubUtil');
|
||||
let Promise = require('bluebird');
|
||||
|
||||
jasmine.getEnv().DEFAULT_TIMEOUT_INTERVAL = 60000;
|
||||
|
||||
describe('HubUtil Integration Tests', () => {
|
||||
describe('auth', () => {
|
||||
pit('successfully authenticates', () => {
|
||||
return new Promise((resolve) => {
|
||||
hubUtil.auth(process.env.INTEGRATION_USER, process.env.INTEGRATION_PASSWORD, (error, response, body) => {
|
||||
expect(response.statusCode).toBe(200);
|
||||
expect(error).toBe(null);
|
||||
setTimeout(() => {
|
||||
hubUtil.auth(process.env.INTEGRATION_USER, process.env.INTEGRATION_PASSWORD, (error, response, body) => {
|
||||
expect(response.statusCode).toBe(200);
|
||||
expect(error).toBe(null);
|
||||
|
||||
let data = JSON.parse(body);
|
||||
expect(data.token).toBeTruthy();
|
||||
resolve();
|
||||
});
|
||||
let data = JSON.parse(body);
|
||||
expect(data.token).toBeTruthy();
|
||||
resolve();
|
||||
});
|
||||
}, 5000);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
jest.autoMockOff();
|
||||
|
||||
// One minute timeout for integration tests
|
||||
jasmine.getEnv().DEFAULT_TIMEOUT_INTERVAL = 60000;
|
||||
jasmine.getEnv().defaultTimeoutInterval = 60000;
|
||||
|
||||
let _ = require('underscore');
|
||||
let regHubUtil = require('../src/utils/RegHubUtil');
|
||||
|
@ -51,7 +50,6 @@ describe('RegHubUtil Integration Tests', () => {
|
|||
return new Promise((resolve) => {
|
||||
hubUtil.login(process.env.INTEGRATION_USER, process.env.INTEGRATION_PASSWORD, () => {
|
||||
regHubUtil.tags(`${process.env.INTEGRATION_USER}/test`, (error, tags) => {
|
||||
console.log(tags);
|
||||
expect(error).toBeFalsy();
|
||||
expect(tags.length).toEqual(1);
|
||||
expect(tags[0].name).toEqual('latest');
|
||||
|
|
Загрузка…
Ссылка в новой задаче