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

@ -10,7 +10,7 @@ script:
- npm run style
- npm run build
- npm run ts-node -- ./demo/demo1.ts
- npm run e2e "My Document.docx"
- npm run e2e "/My Document.docx"
- npm run ts-node -- ./demo/demo2.ts
- npm run ts-node -- ./demo/demo3.ts
- npm run ts-node -- ./demo/demo4.ts
@ -20,7 +20,7 @@ script:
- npm run ts-node -- ./demo/demo8.ts
- npm run ts-node -- ./demo/demo9.ts
- npm run ts-node -- ./demo/demo10.ts
- npm run e2e "My Document.docx"
- npm run e2e "/My Document.docx"
- npm run ts-node -- ./demo/demo11.ts
- npm run ts-node -- ./demo/demo12.ts
- npm run ts-node -- ./demo/demo13.ts
@ -41,7 +41,7 @@ script:
- npm run ts-node -- ./demo/demo28.ts
- npm run ts-node -- ./demo/demo29.ts
- npm run ts-node -- ./demo/demo30.ts
- npm run e2e "My Document.docx"
- npm run e2e "/My Document.docx"
- npm run ts-node -- ./demo/demo31.ts
- npm run ts-node -- ./demo/demo32.ts
- npm run ts-node -- ./demo/demo33.ts

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);
});