oav/regression/validateExamplesRegressionT...

22 строки
565 B
TypeScript
Исходник Постоянная ссылка Обычный вид История

2020-11-24 06:07:36 +03:00
import md5File = require("md5-file");
2020-11-24 06:07:36 +03:00
import * as validate from "../lib/validate";
export const validateExamplesRegressionTest = async (file: string) => {
try {
2020-11-24 06:07:36 +03:00
const hash = await new Promise((resolve) =>
md5File(file).then((h) => {
2020-11-24 06:07:36 +03:00
resolve(h);
})
2020-11-24 06:07:36 +03:00
);
expect(hash).toMatchSnapshot("input file hash");
const result = await validate.validateExamples(file, undefined, {
2020-11-24 06:07:36 +03:00
pretty: true,
});
expect(result).toMatchSnapshot("returned results");
} catch (e) {
2020-11-24 06:07:36 +03:00
expect(e).toMatchSnapshot("thrown exception");
}
2020-11-24 06:07:36 +03:00
};