Skip to content

Commit

Permalink
Use async readFile
Browse files Browse the repository at this point in the history
  • Loading branch information
hannseman committed Feb 22, 2020
1 parent 3fa61e4 commit 42fe488
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cobertura.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
const fs = require("fs");
const fs = require("fs").promises;
const xml2js = require("xml2js");
const util = require("util");
const parseString = util.promisify(xml2js.parseString);

async function processCoverage(path, options) {
options = options || { skipCovered: false };
const xml = fs.readFileSync(path, "utf-8");
const xml = await fs.readFile(path, "utf-8");
const { coverage } = await parseString(xml, {
explicitArray: false,
mergeAttrs: true
Expand Down

0 comments on commit 42fe488

Please sign in to comment.