Skip to content

Commit c282b78

Browse files
author
Pavel Petroshenko
authored
Merge pull request #50 from nobitlost/features/test-dev
Features/test dev
2 parents ec20a90 + 646cecf commit c282b78

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Diff for: spec/ImptTestHelper.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const Utils = require('../lib/util/Utils');
3333
const UserInteractor = require('../lib/util/UserInteractor');
3434
const child_process = require('child_process');
3535

36-
const TIMEOUT_MS = 999999;
36+
const TIMEOUT_MS = 10000000;
3737
const TESTS_EXECUTION_FOLDER = `${__dirname}/../__test${process.env.IMPT_FOLDER_SUFFIX ? process.env.IMPT_FOLDER_SUFFIX : ''}`;
3838
const KEY_ANSWER = {
3939
CTRL_C: '\x03',
@@ -255,6 +255,7 @@ class ImptTestHelper {
255255

256256
// Checks success return code of the command
257257
static checkSuccessStatus(commandOut) {
258+
expect(commandOut.output).not.toMatch(UserInteractor.ERRORS.ACCESS_FAILED);
258259
expect(commandOut.code).toEqual(0);
259260
}
260261

@@ -271,7 +272,7 @@ class ImptTestHelper {
271272

272273
// Checks if the command output contains the specified attribute name and value
273274
static checkAttribute(commandOut, attrName, attrValue) {
274-
expect(commandOut.output).toMatch(new RegExp(`${attrName}"?:\\s+"?${attrValue.replace(new RegExp(/"/g), '\\\\?"')}"?`));
275+
expect(commandOut.output).toMatch(new RegExp(`${attrName}"?:\\s+"?${attrValue.replace(new RegExp(/([\^\[\.\$\{\*\(\\\+\)\|\?\<\>])/g),'\\$&').replace(new RegExp(/"/g), '\\\\?"')}"?`));
275276
}
276277

277278
// Checks if the command output contains the specified message for default or debug output mode

Diff for: spec/build/build_cleanup.spec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ ImptTestHelper.OUTPUT_MODES.forEach((outputMode) => {
261261
ImptTestHelper.runCommand(`impt build cleanup -q ${outputMode}`, (commandOut) => {
262262
_checkSuccessDeleteDeploymentMessage(commandOut, build2_id);
263263
_checkSuccessDeleteDeploymentMessage(commandOut, build4_id);
264-
ImptTestHelper.checkSuccessStatus(commandOut);
264+
ImptTestHelper.emptyCheck(commandOut);
265265
}).
266266
then(() => ImptTestHelper.runCommand(`impt build list -o me --zombie -z json`, (commandOut) => {
267267
expect(commandOut).toContainBuild({ id: build_id });
@@ -282,7 +282,7 @@ ImptTestHelper.OUTPUT_MODES.forEach((outputMode) => {
282282
_checkSuccessDeleteDeploymentMessage(commandOut, build2_id);
283283
_checkSuccessDeleteDeploymentMessage(commandOut, build3_id);
284284
_checkSuccessDeleteDeploymentMessage(commandOut, build4_id);
285-
ImptTestHelper.checkSuccessStatus(commandOut);
285+
ImptTestHelper.emptyCheck(commandOut);
286286
}).
287287
then(() => ImptTestHelper.runCommand(`impt build list -o me --zombie -z json`, (commandOut) => {
288288
expect(commandOut).not.toContainBuild({ id: build_id });

Diff for: spec/device/device_assign.spec.js

-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ ImptTestHelper.OUTPUT_MODES.forEach((outputMode) => {
4949
beforeAll((done) => {
5050
ImptTestHelper.init().
5151
then(() => ImptTestHelper.checkDeviceStatus(config.devices[config.deviceidx])).
52-
then(_testSuiteCleanUp).
5352
then(_testSuiteInit).
5453
then(done).
5554
catch(error => done.fail(error));

0 commit comments

Comments
 (0)