Skip to content

Instantly share code, notes, and snippets.

@javaadpatel
Created April 26, 2020 06:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save javaadpatel/314161fbf568d8db5dcfc252d804668d to your computer and use it in GitHub Desktop.
Save javaadpatel/314161fbf568d8db5dcfc252d804668d to your computer and use it in GitHub Desktop.
Flood Element Execution Script (repository: https://github.com/javaadpatel/Medium_FloodElement_AzureDevops)
const winston = require('./helpers/winston');
const fileCleanup = require("./helpers/file-helper");
const testHelpers = require("./helpers/element-test-helper");
//remove all old results and logs
winston.info(`--- Cleaning up all old files ---`);
fileCleanup();
// register tests to run
const floodTests = [
"./floodTests/test.ts",
];
winston.info("--- Starting Flood Element tests ---");
// run tests
testHelpers.runFloodTests(floodTests)
//log results
.then(testResults => {
testHelpers.logResults(testResults);
return testResults;
})
.then(async testResults => {
await testHelpers.delay(1000);
const testsPassedSuccessfully = testResults.every(test => test.successful === true)
testsPassedSuccessfully ? winston.info(`All tests passed successfully!`) : winston.info(`One/All tests passed failed!`);
winston.info("--- Completed Flood Element tests ---");
testsPassedSuccessfully ? process.exit(0) : process.exit(1);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment