Fix tests and build

Remove unused code and dependencies
This commit is contained in:
Dolan Miu
2023-06-08 13:30:31 +01:00
parent a0a88412ff
commit 09ab91eeef
19 changed files with 22322 additions and 26082 deletions

View File

@ -1,30 +0,0 @@
// tslint:disable:no-console
import * as fs from "fs";
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: {
document: fs.createReadStream(filePath),
},
});
return result;
}
e2e(process.argv[2])
.then(() => {
console.log("Success! Document is valid");
})
.catch(() => {
console.log("Error! Validation failed");
process.exit(1);
});

View File

@ -1,18 +0,0 @@
import * as glob from "glob";
import { replaceInFile } from "replace-in-file";
const files = glob.sync("build/**/*.d.ts");
for (const file of files) {
replaceInFile({
files: file,
from: /"@[a-z/-]*"/gi,
to: (match) => {
const matchSlug = match.replace(/['"]+/g, "").replace(/[@]+/g, "").trim();
const levelCount = file.split(/[\/\\]/).length - 2;
const backLevels = Array(levelCount).fill("../").join("");
return `"${backLevels}${matchSlug}"`;
},
});
}