Skip to content

Commit

Permalink
fix(deps): update dependency glob to v8.0.3 (#3531)
Browse files Browse the repository at this point in the history
* fix(deps): update dependency glob to v8.0.3
* Fix unit test for node glob

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Nico Jansen <jansennico@gmail.com>
  • Loading branch information
3 people committed May 29, 2022
1 parent b8404fe commit bb5611a
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 64 deletions.
32 changes: 0 additions & 32 deletions e2e/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 9 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"eslint-plugin-prettier": "4.0.0",
"eslint-plugin-unicorn": "42.0.0",
"execa": "6.1.0",
"glob": "8.0.1",
"glob": "8.0.3",
"install-local": "3.0.1",
"jasmine": "4.1.0",
"jasmine-core": "4.1.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"execa": "~6.1.0",
"file-url": "~4.0.0",
"get-port": "~6.1.0",
"glob": "~7.2.0",
"glob": "~8.0.0",
"inquirer": "~8.2.0",
"lodash.flatmap": "~4.5.0",
"lodash.groupby": "~4.6.0",
Expand Down
36 changes: 17 additions & 19 deletions packages/core/test/integration/utils/file-utils.it.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@ import os from 'os';
import path from 'path';
import { promises as fsPromises } from 'fs';

import mkdirp from 'mkdirp';
import { promisify } from 'util';

import mkdirp from 'mkdirp';
import { expect } from 'chai';
import { File } from '@stryker-mutator/util';
import nodeGlob from 'glob';
import { File } from '@stryker-mutator/util';
import { assertions } from '@stryker-mutator/test-helpers';

import { fileUtils } from '../../../src/utils/file-utils.js';

const glob = promisify(nodeGlob);

describe('fileUtils', () => {
describe('moveDirectoryRecursiveSync', () => {
const from = path.resolve(os.tmpdir(), 'moveDirectoryRecursiveSyncFrom');
Expand Down Expand Up @@ -68,23 +71,18 @@ describe('fileUtils', () => {
});

async function readDirRecursive(dir: string): Promise<File[]> {
return new Promise<File[]>((res, rej) => {
nodeGlob(path.join(dir, '**/*'), { nodir: true }, (err, matches) => {
if (err) {
rej(err);
}
// eslint-disable-next-line @typescript-eslint/require-array-sort-compare
matches.sort();
res(
Promise.all(
matches.map(async (fileName) => {
const content = await fsPromises.readFile(fileName);
return new File(path.normalize(fileName), content);
})
)
);
});
});
const fileNames = await glob('**/*', { cwd: dir, nodir: true });
const files = Promise.all(
// eslint-disable-next-line @typescript-eslint/require-array-sort-compare
fileNames
.sort()
.map((fileName) => path.resolve(dir, fileName))
.map(async (fileName) => {
const content = await fsPromises.readFile(fileName);
return new File(path.normalize(fileName), content);
})
);
return files;
}

async function writeAll(...files: File[]): Promise<void> {
Expand Down

0 comments on commit bb5611a

Please sign in to comment.