DiffCov/tests/parse-lcov.spec.ts

12 lines
427 B
TypeScript
Raw Permalink Normal View History

2022-10-24 18:48:49 +00:00
import fs from "fs";
import path from "path";
// eslint-disable-next-line @typescript-eslint/no-var-requires
const parseLcov = require("../src/lcov-parser");
test.each(["1.lcov.info"])("parse %s", async (lcovFile) => {
const lcovFilePath = path.resolve(__dirname, "..", "data", lcovFile);
const lcovContent = fs.readFileSync(lcovFilePath).toString();
expect(await parseLcov.default(lcovContent)).toMatchSnapshot();
});