Skip to content

Commit

Permalink
fix glob imports
Browse files Browse the repository at this point in the history
  • Loading branch information
rmccar committed Sep 21, 2023
1 parent a8b93f4 commit ed79d0d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions backstop.config-for-docker.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lighthouse/lighthouse-get-urls.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const fs = require('fs');
const util = require('util');
const glob = util.promisify(require('glob'));
const { glob } = require('glob');
const readdir = util.promisify(fs.readdir);

async function createURLsFile() {
Expand Down
5 changes: 2 additions & 3 deletions src/tests/helpers/url-generator.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
const fs = require('fs');
const util = require('util');
const glob = require('glob');

const globUtil = util.promisify(glob);
const { glob } = require('glob');
const readdir = util.promisify(fs.readdir);

const testURL = `http://host.docker.internal:3010`;
Expand All @@ -23,7 +22,7 @@ export default async () => {
for (const directory of directories) {
const folders = await readdir(directory.path);
for (const folder of folders) {
const files = await globUtil(`${directory.path}/${folder}/**/example-*.njk`);
const files = await glob(`${directory.path}/${folder}/**/example-*.njk`);
for (const file of files) {
const urlPath = file.replace(/^\.\/src\/(.*\/example-.*?)\.njk$/, '/$1');
urls.push({ url: `${testURL}${urlPath}`, label: urlPath, delay: 1000 });
Expand Down

0 comments on commit ed79d0d

Please sign in to comment.