flex-plugin-e2e-tests
Advanced tools
Comparing version 4.7.6-nightly.20210424 to 4.7.6-nightly.20210425
@@ -8,4 +8,9 @@ export interface TestParams { | ||
dir: string; | ||
}; | ||
} & Partial<TestParamsBuilder>; | ||
} | ||
interface TestParamsBuilder { | ||
newlineValue: string; | ||
changelog: string; | ||
version: string; | ||
} | ||
export interface TestSuite { | ||
@@ -16,1 +21,2 @@ description: string; | ||
export declare const homeDir: string; | ||
export {}; |
@@ -38,2 +38,23 @@ "use strict"; | ||
}; | ||
var __read = (this && this.__read) || function (o, n) { | ||
var m = typeof Symbol === "function" && o[Symbol.iterator]; | ||
if (!m) return o; | ||
var i = m.call(o), r, ar = [], e; | ||
try { | ||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); | ||
} | ||
catch (error) { e = { error: error }; } | ||
finally { | ||
try { | ||
if (r && !r.done && (m = i["return"])) m.call(i); | ||
} | ||
finally { if (e) throw e.error; } | ||
} | ||
return ar; | ||
}; | ||
var __spreadArray = (this && this.__spreadArray) || function (to, from) { | ||
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) | ||
to[j] = from[i]; | ||
return to; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -44,2 +65,3 @@ exports.homeDir = void 0; | ||
var flex_plugins_utils_logger_1 = require("flex-plugins-utils-logger"); | ||
var utils_1 = require("./utils"); | ||
var testSuites = fs_1.readdirSync(__dirname + "/tests") | ||
@@ -65,5 +87,16 @@ .filter(function (f) { return f.endsWith('.js'); }) | ||
}; | ||
var getArg = function (flag) { | ||
var index = process.argv.indexOf(flag); | ||
return process.argv[index + 1]; | ||
var getArgs = function (flag) { | ||
var _get = function () { | ||
var argv = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
argv[_i] = arguments[_i]; | ||
} | ||
var index = argv.indexOf(flag); | ||
if (index === -1) { | ||
return []; | ||
} | ||
var arg = argv[index + 1]; | ||
return __spreadArray([arg], __read(_get.apply(void 0, __spreadArray([], __read(argv.splice(index + 1)))))); | ||
}; | ||
return _get.apply(void 0, __spreadArray([], __read(process.argv))); | ||
}; | ||
@@ -87,3 +120,3 @@ var runTest = function (step) { return __awaiter(void 0, void 0, void 0, function () { | ||
(function () { return __awaiter(void 0, void 0, void 0, function () { | ||
var i, step; | ||
var i, steps, i; | ||
return __generator(this, function (_a) { | ||
@@ -97,21 +130,32 @@ switch (_a.label) { | ||
Object.keys(testParams).forEach(function (key) { return flex_plugins_utils_logger_1.logger.info("- " + key + ": " + JSON.stringify(testParams[key])); }); | ||
if (!!process.argv.includes('--step')) return [3 /*break*/, 5]; | ||
return [4 /*yield*/, utils_1.api.cleanup()]; | ||
case 1: | ||
_a.sent(); | ||
if (!!process.argv.includes('--step')) return [3 /*break*/, 6]; | ||
i = 0; | ||
_a.label = 1; | ||
case 1: | ||
if (!(i < testSuites.length)) return [3 /*break*/, 4]; | ||
_a.label = 2; | ||
case 2: | ||
if (!(i < testSuites.length)) return [3 /*break*/, 5]; | ||
return [4 /*yield*/, runTest(i + 1)]; | ||
case 2: | ||
case 3: | ||
_a.sent(); | ||
_a.label = 3; | ||
case 3: | ||
_a.label = 4; | ||
case 4: | ||
i++; | ||
return [3 /*break*/, 1]; | ||
case 4: return [2 /*return*/]; | ||
case 5: | ||
step = getArg('--step'); | ||
return [4 /*yield*/, runTest(parseInt(step, 10))]; | ||
return [3 /*break*/, 2]; | ||
case 5: return [2 /*return*/]; | ||
case 6: | ||
steps = getArgs('--step'); | ||
i = 0; | ||
_a.label = 7; | ||
case 7: | ||
if (!(i < steps.length)) return [3 /*break*/, 10]; | ||
return [4 /*yield*/, runTest(parseInt(steps[i], 10))]; | ||
case 8: | ||
_a.sent(); | ||
return [2 /*return*/]; | ||
_a.label = 9; | ||
case 9: | ||
i++; | ||
return [3 /*break*/, 7]; | ||
case 10: return [2 /*return*/]; | ||
} | ||
@@ -118,0 +162,0 @@ }); |
@@ -1,5 +0,3 @@ | ||
/// <reference types="node" /> | ||
import { strictEqual, notStrictEqual } from 'assert'; | ||
declare const _default: { | ||
equal: typeof strictEqual; | ||
equal: (actual: any, expected: any, msg?: string | undefined) => void; | ||
fileExists: (paths: string[], msg?: string | undefined) => void; | ||
@@ -9,2 +7,3 @@ jsonFileContains: <T>(paths: string[], key: string, value: T, msg?: string | undefined) => void; | ||
dirIsEmpty: (paths: string[], msg?: string | undefined) => void; | ||
stringContains: (line: string, str: string, msg?: string | undefined) => void; | ||
not: { | ||
@@ -15,5 +14,6 @@ fileExists: (paths: string[], msg?: string | undefined) => void; | ||
dirIsEmpty: (paths: string[], msg?: string | undefined) => void; | ||
equal: typeof notStrictEqual; | ||
stringContains: (line: string, str: string, msg?: string | undefined) => void; | ||
equal: (actual: any, expected: any, msg?: string | undefined) => void; | ||
}; | ||
}; | ||
export default _default; |
@@ -50,8 +50,12 @@ "use strict"; | ||
if (doesEqual) { | ||
assert_1.strictEqual(actual, expected, msg); | ||
assert_1.deepStrictEqual(actual, expected, msg); | ||
} | ||
else { | ||
assert_1.notStrictEqual(actual, expected, msg); | ||
assert_1.notDeepStrictEqual(actual, expected, msg); | ||
} | ||
}; | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
var equal = function (doesEqual) { return function (actual, expected, msg) { | ||
_strictEqual(doesEqual, actual, expected, msg); | ||
}; }; | ||
/** | ||
@@ -69,2 +73,5 @@ * Checks whether a file/directory exists | ||
}; }; | ||
var stringContains = function (doesEqual) { return function (line, str, msg) { | ||
_strictEqual(doesEqual, true, line.includes(str), msg); | ||
}; }; | ||
/** | ||
@@ -77,3 +84,3 @@ * Checks whether the file contains the given string | ||
msg = msg || file + " does" + not + "contain " + value; | ||
_strictEqual(doesEqual, true, fs.readFileSync(file, 'utf-8').includes(value), msg); | ||
stringContains(doesEqual)(fs.readFileSync(file, 'utf-8'), value, msg); | ||
}; }; | ||
@@ -87,3 +94,3 @@ /** | ||
exports.default = { | ||
equal: assert_1.strictEqual, | ||
equal: equal(true), | ||
fileExists: fileExists(true), | ||
@@ -93,2 +100,3 @@ jsonFileContains: jsonFileContains(true), | ||
dirIsEmpty: dirIsEmpty(true), | ||
stringContains: stringContains(true), | ||
not: { | ||
@@ -99,5 +107,6 @@ fileExists: fileExists(false), | ||
dirIsEmpty: dirIsEmpty(false), | ||
equal: assert_1.notStrictEqual, | ||
stringContains: stringContains(false), | ||
equal: equal(false), | ||
}, | ||
}; | ||
//# sourceMappingURL=assertion.js.map |
export { default as spawn, logResult } from './spawn'; | ||
export { default as assertion } from './assertion'; | ||
export { join as joinPath } from 'path'; | ||
export { default as api } from './api'; |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.joinPath = exports.assertion = exports.logResult = exports.spawn = void 0; | ||
exports.api = exports.joinPath = exports.assertion = exports.logResult = exports.spawn = void 0; | ||
var spawn_1 = require("./spawn"); | ||
@@ -15,2 +15,4 @@ Object.defineProperty(exports, "spawn", { enumerable: true, get: function () { return __importDefault(spawn_1).default; } }); | ||
Object.defineProperty(exports, "joinPath", { enumerable: true, get: function () { return path_1.join; } }); | ||
var api_1 = require("./api"); | ||
Object.defineProperty(exports, "api", { enumerable: true, get: function () { return __importDefault(api_1).default; } }); | ||
//# sourceMappingURL=index.js.map |
@@ -72,3 +72,3 @@ "use strict"; | ||
var spawnOptions = __assign(__assign({}, defaultOptions), options); | ||
flex_plugins_utils_logger_1.logger.info("Running spawn command: **" + cmd + " " + args.join(' ') + "**"); | ||
flex_plugins_utils_logger_1.logger.info("Running spawn command: **" + cmd + " " + args.join(' ').replace(/-/g, '\\-') + "**"); | ||
flex_plugins_utils_logger_1.logger.debug("Spawn options are **" + JSON.stringify(options) + "**"); | ||
@@ -117,5 +117,5 @@ var child = child_process_1.spawn(cmd, args, spawnOptions); | ||
var logResult = function (result) { | ||
flex_plugins_utils_logger_1.logger.info(result.stdout); | ||
flex_plugins_utils_logger_1.logger.info(result.stdout.replace(/-/g, '\\-')); | ||
if (result.stderr) { | ||
flex_plugins_utils_logger_1.logger.warning(result.stderr); | ||
flex_plugins_utils_logger_1.logger.warning(result.stderr.replace(/-/g, '\\-')); | ||
} | ||
@@ -122,0 +122,0 @@ }; |
{ | ||
"name": "flex-plugin-e2e-tests", | ||
"version": "4.7.6-nightly.20210424", | ||
"version": "4.7.6-nightly.20210425", | ||
"description": "Flex Plugin E2E Tests framework", | ||
@@ -37,8 +37,11 @@ "keywords": [ | ||
"dependencies": { | ||
"flex-plugins-utils-logger": "4.7.6-nightly.20210424", | ||
"flex-plugins-api-client": "4.7.6-nightly.20210425", | ||
"flex-plugins-utils-logger": "4.7.6-nightly.20210425", | ||
"lodash": "4.17.21", | ||
"replace-in-file": "^6.2.0" | ||
"replace-in-file": "^6.2.0", | ||
"semver": "^7.3.5" | ||
}, | ||
"devDependencies": { | ||
"@types/lodash": "4.14.168" | ||
"@types/lodash": "4.14.168", | ||
"@types/semver": "^7.3.4" | ||
}, | ||
@@ -48,3 +51,3 @@ "engines": { | ||
}, | ||
"gitHead": "1ca4b8ebd53b824b57b8d58b808990959adcf414" | ||
"gitHead": "3b07ee17adb8bc21a4f3e07994401ea56274180c" | ||
} |
@@ -20,3 +20,3 @@  | ||
rm -rf ~/.local | ||
PACKAGE_VERSION="4.7.5-beta.0" npm start | ||
TWILIO_ACCOUNT_SID=ACxxx TWILIO_AUTH_TOKEN=123 PACKAGE_VERSION="4.7.5-beta.0" npm start | ||
``` | ||
@@ -27,5 +27,11 @@ | ||
```bash | ||
PACKAGE_VERSION="4.7.5-beta.0" npm start -- --step 2 | ||
... npm start -- --step 2 | ||
``` | ||
To run multiple steps: | ||
```bash | ||
... npm start -- --step 2 --step 3 --step 10 | ||
``` | ||
## Contributors | ||
@@ -32,0 +38,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
82331
42
1130
42
5
2
13
+ Addedsemver@^7.3.5
+ Addedavailable-typed-arrays@1.0.7(transitive)
+ Addedaxios@0.21.4(transitive)
+ Addedaxios-cache-adapter@2.7.3(transitive)
+ Addedcache-control-esm@1.0.0(transitive)
+ Addedcall-bind@1.0.8(transitive)
+ Addedcall-bind-apply-helpers@1.0.2(transitive)
+ Addedcall-bound@1.0.3(transitive)
+ Addedcharenc@0.0.2(transitive)
+ Addedcrypt@0.0.2(transitive)
+ Addeddefine-data-property@1.1.4(transitive)
+ Addeddunder-proto@1.0.1(transitive)
+ Addedes-define-property@1.0.1(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedes-object-atoms@1.1.1(transitive)
+ Addedflex-plugin-utils-http@4.7.6-nightly.20210425(transitive)
+ Addedflex-plugins-api-client@4.7.6-nightly.20210425(transitive)
+ Addedflex-plugins-utils-env@4.7.6-nightly.20210425(transitive)
+ Addedflex-plugins-utils-exception@4.7.6-nightly.20210425(transitive)
+ Addedflex-plugins-utils-logger@4.7.6-nightly.20210425(transitive)
+ Addedfollow-redirects@1.15.9(transitive)
+ Addedfor-each@0.3.5(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-intrinsic@1.3.0(transitive)
+ Addedget-proto@1.0.1(transitive)
+ Addedgopd@1.2.0(transitive)
+ Addedhas-property-descriptors@1.0.2(transitive)
+ Addedhas-symbols@1.1.0(transitive)
+ Addedhas-tostringtag@1.0.2(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedis-arguments@1.2.0(transitive)
+ Addedis-buffer@1.1.6(transitive)
+ Addedis-callable@1.2.7(transitive)
+ Addedis-generator-function@1.1.0(transitive)
+ Addedis-regex@1.2.1(transitive)
+ Addedis-typed-array@1.1.15(transitive)
+ Addedlodash.upperfirst@4.3.1(transitive)
+ Addedmath-intrinsics@1.1.0(transitive)
+ Addedmd5@2.3.0(transitive)
+ Addedobject-inspect@1.13.4(transitive)
+ Addedpossible-typed-array-names@1.1.0(transitive)
+ Addedqs@6.14.0(transitive)
+ Addedsafe-regex-test@1.1.0(transitive)
+ Addedsemver@7.7.1(transitive)
+ Addedset-function-length@1.2.2(transitive)
+ Addedside-channel@1.1.0(transitive)
+ Addedside-channel-list@1.0.0(transitive)
+ Addedside-channel-map@1.0.1(transitive)
+ Addedside-channel-weakmap@1.0.2(transitive)
+ Addedurl-join@4.0.1(transitive)
+ Addedutil@0.12.5(transitive)
+ Addedwhich-typed-array@1.1.18(transitive)
- Removedflex-plugins-utils-env@4.7.6-nightly.20210424(transitive)
- Removedflex-plugins-utils-logger@4.7.6-nightly.20210424(transitive)