Add Error for e2e test
This commit is contained in:
@ -10,7 +10,7 @@ script:
|
|||||||
- npm run style
|
- npm run style
|
||||||
- npm run build
|
- npm run build
|
||||||
- npm run ts-node -- ./demo/demo1.ts
|
- 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/demo2.ts
|
||||||
- npm run ts-node -- ./demo/demo3.ts
|
- npm run ts-node -- ./demo/demo3.ts
|
||||||
- npm run ts-node -- ./demo/demo4.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/demo8.ts
|
||||||
- npm run ts-node -- ./demo/demo9.ts
|
- npm run ts-node -- ./demo/demo9.ts
|
||||||
- npm run ts-node -- ./demo/demo10.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/demo11.ts
|
||||||
- npm run ts-node -- ./demo/demo12.ts
|
- npm run ts-node -- ./demo/demo12.ts
|
||||||
- npm run ts-node -- ./demo/demo13.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/demo28.ts
|
||||||
- npm run ts-node -- ./demo/demo29.ts
|
- npm run ts-node -- ./demo/demo29.ts
|
||||||
- npm run ts-node -- ./demo/demo30.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/demo31.ts
|
||||||
- npm run ts-node -- ./demo/demo32.ts
|
- npm run ts-node -- ./demo/demo32.ts
|
||||||
- npm run ts-node -- ./demo/demo33.ts
|
- npm run ts-node -- ./demo/demo33.ts
|
||||||
|
@ -5,6 +5,11 @@ import * as request from "request-promise";
|
|||||||
async function e2e(filePath: string): Promise<void> {
|
async function e2e(filePath: string): Promise<void> {
|
||||||
console.log(`Running e2e for: ${filePath}`);
|
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({
|
const result = await request.post({
|
||||||
url: "https://wt-9017166451e5dc00461b648d19f5e8da-0.sandbox.auth0-extend.com/docx-validator",
|
url: "https://wt-9017166451e5dc00461b648d19f5e8da-0.sandbox.auth0-extend.com/docx-validator",
|
||||||
formData: {
|
formData: {
|
||||||
@ -21,4 +26,5 @@ e2e(process.argv[2])
|
|||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
console.log("Error! Validation failed");
|
console.log("Error! Validation failed");
|
||||||
|
process.exit(1);
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user