run prettier on type script files (#465)
This commit is contained in:
Родитель
a1619e2514
Коммит
a52ed777bc
|
@ -8,16 +8,16 @@ chai.use(chaiAsPromised);
|
|||
|
||||
describe("yamlFileValidator", () => {
|
||||
it("should pass when yaml file is valid", async () => {
|
||||
|
||||
let result = await IsValidYamlFile(".script/tests/yamlFileValidatorTest/validFile.yaml");
|
||||
|
||||
expect(result).to.equal(ExitCode.SUCCESS);
|
||||
});
|
||||
|
||||
it("should throw exception when yaml file is invalid", async () => {
|
||||
|
||||
let filePath = ".script/tests/yamlFileValidatorTest/invalidFile.yaml";
|
||||
|
||||
await expect(IsValidYamlFile(filePath)).eventually.rejectedWith(Error).and.have.property("name", "YAMLException");
|
||||
await expect(IsValidYamlFile(filePath))
|
||||
.eventually.rejectedWith(Error)
|
||||
.and.have.property("name", "YAMLException");
|
||||
});
|
||||
});
|
||||
|
|
|
@ -8,15 +8,8 @@ export type CheckOptions = {
|
|||
onFinalFailed(): Promise<unknown>;
|
||||
};
|
||||
|
||||
async function changedFilesValidator(
|
||||
checkOptions: CheckOptions,
|
||||
fileTypeSuffixes?: string[],
|
||||
filePathFolderPreffixes?: string[]
|
||||
) {
|
||||
const changedFiles = await GetDiffFiles(
|
||||
fileTypeSuffixes,
|
||||
filePathFolderPreffixes
|
||||
);
|
||||
async function changedFilesValidator(checkOptions: CheckOptions, fileTypeSuffixes?: string[], filePathFolderPreffixes?: string[]) {
|
||||
const changedFiles = await GetDiffFiles(fileTypeSuffixes, filePathFolderPreffixes);
|
||||
if (changedFiles === undefined) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -22,7 +22,8 @@ export async function GetDiffFiles(fileTypeSuffixes?: string[], filePathFolderPr
|
|||
.filter(filePath => filePath.indexOf(".script/tests") === -1);
|
||||
|
||||
if (filterChangedFiles.length === 0) {
|
||||
logger.logWarning(`No changed files in current PR after files filter. File type filter: ${fileTypeSuffixes ? fileTypeSuffixes.toString() : null}, File path filter: ${filePathFolderPreffixes ? filePathFolderPreffixes.toString() : null}`);
|
||||
logger.logWarning(`No changed files in current PR after files filter. File type filter: ${fileTypeSuffixes ? fileTypeSuffixes.toString() : null},
|
||||
File path filter: ${filePathFolderPreffixes ? filePathFolderPreffixes.toString() : null}`);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче