Fix linting and add new lint rules

This commit is contained in:
Dolan Miu
2022-09-19 20:48:50 +01:00
parent e90d97b813
commit 5950055cca
13 changed files with 78 additions and 46 deletions

View File

@ -54,7 +54,7 @@ describe("Packer", () => {
assert.isTrue(buffer.byteLength > 0);
});
it("should handle exception if it throws any", async () => {
it("should handle exception if it throws any", () => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const compiler = stub((Packer as any).compiler, "compile");
@ -139,7 +139,7 @@ describe("Packer", () => {
const stream = await Packer.toStream(file);
return new Promise((resolve, reject) => {
stream.on("error", () => {
reject();
reject(new Error());
});
stream.on("end", () => {
@ -148,7 +148,7 @@ describe("Packer", () => {
});
});
it("should handle exception if it throws any", async () => {
it("should handle exception if it throws any", () => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const compiler = stub((Packer as any).compiler, "compile").callsFake(() => ({
// tslint:disable-next-line: no-empty
@ -160,9 +160,11 @@ describe("Packer", () => {
}));
compiler.throwsException();
return Packer.toStream(file).catch((error) => {
try {
Packer.toStream(file);
} catch (error) {
assert.isDefined(error);
});
}
});
afterEach(() => {