mirror of
https://github.com/balena-io/etcher.git
synced 2025-04-24 15:27:17 +00:00
test(image-stream): move extraction timeout to a shared constant (#1599)
The image stream tests that extract images all have a 20s timeout, which is manually set in all the suites related to extraction. This commit extracts that number as a constant called DEFAULT_TIMEOUT. See: https://github.com/resin-io/etcher/pull/1595 Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
This commit is contained in:
parent
76b6bdfd06
commit
a772877ae1
@ -20,11 +20,12 @@ const m = require('mochainon');
|
||||
const path = require('path');
|
||||
const zipHooks = require('../../../lib/image-stream/archive-hooks/zip');
|
||||
const utils = require('../../../lib/image-stream/utils');
|
||||
const tester = require('../tester');
|
||||
const ZIP_PATH = path.join(__dirname, '..', 'data', 'zip');
|
||||
|
||||
describe('ImageStream: Archive hooks: ZIP', function() {
|
||||
|
||||
this.timeout(20000);
|
||||
this.timeout(tester.DEFAULT_IMAGE_TESTS_TIMEOUT);
|
||||
|
||||
describe('.getEntries()', function() {
|
||||
|
||||
|
@ -27,7 +27,7 @@ const tester = require('./tester');
|
||||
|
||||
describe('ImageStream: BZ2', function() {
|
||||
|
||||
this.timeout(20000);
|
||||
this.timeout(tester.DEFAULT_IMAGE_TESTS_TIMEOUT);
|
||||
|
||||
describe('compression method', function() {
|
||||
|
||||
|
@ -27,7 +27,7 @@ const tester = require('./tester');
|
||||
|
||||
describe('ImageStream: DMG', function() {
|
||||
|
||||
this.timeout(20000);
|
||||
this.timeout(tester.DEFAULT_IMAGE_TESTS_TIMEOUT);
|
||||
|
||||
describe('compression method', function() {
|
||||
|
||||
|
@ -27,7 +27,7 @@ const tester = require('./tester');
|
||||
|
||||
describe('ImageStream: GZ', function() {
|
||||
|
||||
this.timeout(20000);
|
||||
this.timeout(tester.DEFAULT_IMAGE_TESTS_TIMEOUT);
|
||||
|
||||
describe('.getFromFilePath()', function() {
|
||||
|
||||
|
@ -26,7 +26,7 @@ const tester = require('./tester');
|
||||
|
||||
describe('ImageStream: IMG', function() {
|
||||
|
||||
this.timeout(20000);
|
||||
this.timeout(tester.DEFAULT_IMAGE_TESTS_TIMEOUT);
|
||||
|
||||
describe('.getFromFilePath()', function() {
|
||||
|
||||
|
@ -26,7 +26,7 @@ const tester = require('./tester');
|
||||
|
||||
describe('ImageStream: ISO', function() {
|
||||
|
||||
this.timeout(20000);
|
||||
this.timeout(tester.DEFAULT_IMAGE_TESTS_TIMEOUT);
|
||||
|
||||
describe('.getFromFilePath()', function() {
|
||||
|
||||
|
@ -43,6 +43,8 @@ const deleteIfExists = (file) => {
|
||||
});
|
||||
};
|
||||
|
||||
exports.DEFAULT_IMAGE_TESTS_TIMEOUT = 20000;
|
||||
|
||||
exports.expectError = function(file, errorMessage, errorDetail) {
|
||||
it('should be rejected with an error', function() {
|
||||
return imageStream.getFromFilePath(file).catch((error) => {
|
||||
|
@ -27,7 +27,7 @@ const tester = require('./tester');
|
||||
|
||||
describe('ImageStream: XZ', function() {
|
||||
|
||||
this.timeout(20000);
|
||||
this.timeout(tester.DEFAULT_IMAGE_TESTS_TIMEOUT);
|
||||
|
||||
describe('.getFromFilePath()', function() {
|
||||
|
||||
|
@ -27,7 +27,7 @@ const tester = require('./tester');
|
||||
|
||||
describe('ImageStream: ZIP', function() {
|
||||
|
||||
this.timeout(20000);
|
||||
this.timeout(tester.DEFAULT_IMAGE_TESTS_TIMEOUT);
|
||||
|
||||
describe('.getFromFilePath()', function() {
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user