cosmetic fixes
This commit is contained in:
Родитель
2bae03bdd1
Коммит
912c2c7047
|
@ -1,6 +1,6 @@
|
|||
import fs from "fs";
|
||||
import { runCheckOverChangedFiles } from "./utils/changedFilesValidator";
|
||||
import { ExitCode } from "./utils/exitCode";
|
||||
import fs from "fs";
|
||||
import * as logger from "./utils/logger";
|
||||
|
||||
export async function IsValidJsonFile(filePath: string): Promise<ExitCode> {
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import chai, { expect } from "chai";
|
||||
import chaiAsPromised from "chai-as-promised";
|
||||
import { IsValidJsonFile } from "../../jsonFileValidator";
|
||||
import { ExitCode } from "../../utils/exitCode";
|
||||
import chai from "chai";
|
||||
import { expect } from "chai";
|
||||
import chaiAsPromised from "chai-as-promised";
|
||||
|
||||
chai.use(chaiAsPromised);
|
||||
|
||||
|
@ -15,6 +16,8 @@ describe("jsonFileValidator", () => {
|
|||
it("should throw exception when json file is invalid", async () => {
|
||||
let filePath = ".script/tests/jsonFileValidatorTest/invalidFile.json";
|
||||
|
||||
await expect(IsValidJsonFile(filePath)).eventually.rejectedWith(Error).and.have.property("name", "SyntaxError");
|
||||
await expect(IsValidJsonFile(filePath))
|
||||
.eventually.rejectedWith(Error)
|
||||
.and.have.property("name", "SyntaxError");
|
||||
});
|
||||
});
|
||||
|
|
|
@ -36,7 +36,7 @@ async function changedFilesValidator(checkOptions: CheckOptions, fileKinds: stri
|
|||
}
|
||||
|
||||
export function runCheckOverChangedFiles(options: CheckOptions, fileKinds: string[], fileTypeSuffixes?: string[], filePathFolderPrefixes?: string[]) {
|
||||
changedFilesValidator(options, fileKinds, fileTypeSuffixes, filePathFolderPrefixes).catch((e) => {
|
||||
changedFilesValidator(options, fileKinds, fileTypeSuffixes, filePathFolderPrefixes).catch(e => {
|
||||
console.error(e);
|
||||
logger.logError(`Error. If issue persists - please open an issue`);
|
||||
process.exit(ExitCode.ERROR);
|
||||
|
|
Загрузка…
Ссылка в новой задаче