Add Error for e2e test

This commit is contained in:
Dolan
2019-01-15 00:34:40 +00:00
parent b37d2c141d
commit 50209bb435
2 changed files with 9 additions and 3 deletions

View File

@ -5,6 +5,11 @@ import * as request from "request-promise";
async function e2e(filePath: string): Promise<void> {
console.log(`Running e2e for: ${filePath}`);
if (!fs.existsSync(filePath)) {
console.error("File not found");
throw Error("File not found");
}
const result = await request.post({
url: "https://wt-9017166451e5dc00461b648d19f5e8da-0.sandbox.auth0-extend.com/docx-validator",
formData: {
@ -21,4 +26,5 @@ e2e(process.argv[2])
})
.catch(() => {
console.log("Error! Validation failed");
process.exit(1);
});