Skip to content

Commit

Permalink
build(deps-dev): bump glob from 8.1.0 to 9.1.0 (#475)
Browse files Browse the repository at this point in the history
* build(deps-dev): bump glob from 8.1.0 to 9.1.0

Bumps [glob](https://github.com/isaacs/node-glob) from 8.1.0 to 9.1.0.
- [Release notes](https://github.com/isaacs/node-glob/releases)
- [Changelog](https://github.com/isaacs/node-glob/blob/main/changelog.md)
- [Commits](isaacs/node-glob@v8.1.0...v9.1.0)

---
updated-dependencies:
- dependency-name: glob
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* test(index): async removal of test files

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Frazer Smith <frazer.dev@outlook.com>
  • Loading branch information
dependabot[bot] and Fdawgs authored Mar 1, 2023
1 parent 6b8976b commit 899020d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 19 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-security": "^1.7.1",
"eslint-plugin-security-node": "^1.1.1",
"glob": "^8.1.0",
"glob": "^9.1.0",
"husky": "^8.0.3",
"jest": "^29.4.2",
"jsdoc-to-markdown": "^8.0.0",
Expand Down
30 changes: 12 additions & 18 deletions src/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* eslint-disable security/detect-child-process */
/* eslint-disable security/detect-non-literal-fs-filename */
const fs = require("fs");
const glob = require("glob");
const { glob } = require("glob");
const path = require("upath");
const { execFile } = require("child_process");
const { promisify } = require("util");
Expand Down Expand Up @@ -38,25 +38,19 @@ switch (process.platform) {
break;
}

/**
* @description Removes leftover test files.
* @returns {Promise<string>} 'done' on resolve.
*/
function clean() {
return new Promise((resolve) => {
const files = glob.GlobSync(
`${testDirectory}!(test.txt|pdf_1.3_NHS_Constitution.pdf|pdf_1.3_NHS_Constitution_attached_detach.pdf|pdf_1.7_NHS_Constitution_Handbook.pdf)`
).found;
files.forEach((foundFile) => {
fs.unlinkSync(foundFile);
});
resolve("done");
});
}

describe("Node-Poppler module", () => {
afterEach(async () => {
await clean();
// Remove leftover test files
const files = await glob(`${testDirectory}**/*`, {
ignore: [
`${testDirectory}/pdf_1.3_NHS_Constitution_attached_detach.pdf`,
`${testDirectory}/pdf_1.3_NHS_Constitution.pdf`,
`${testDirectory}/pdf_1.7_NHS_Constitution_Handbook.pdf`,
`${testDirectory}/test.txt`,
],
});

await Promise.all(files.map((filed) => fs.promises.unlink(filed)));
});

describe("Constructor", () => {
Expand Down

0 comments on commit 899020d

Please sign in to comment.