test: use expect(dir).to.be.an.instanceof(fs.Dirent); (#37331)
This commit is contained in:
parent
cf10c19c33
commit
0d8dd61257
1 changed files with 4 additions and 4 deletions
|
@ -899,7 +899,7 @@ describe('asar package', function () {
|
|||
const p = path.join(asarDir, 'a.asar');
|
||||
const dirs = fs.readdirSync(p, { withFileTypes: true });
|
||||
for (const dir of dirs) {
|
||||
expect(dir instanceof fs.Dirent).to.be.true();
|
||||
expect(dir).to.be.an.instanceof(fs.Dirent);
|
||||
}
|
||||
const names = dirs.map(a => a.name);
|
||||
expect(names).to.deep.equal(['dir1', 'dir2', 'dir3', 'file1', 'file2', 'file3', 'link1', 'link2', 'ping.js']);
|
||||
|
@ -909,7 +909,7 @@ describe('asar package', function () {
|
|||
const p = path.join(asarDir, 'a.asar', 'dir3');
|
||||
const dirs = fs.readdirSync(p, { withFileTypes: true });
|
||||
for (const dir of dirs) {
|
||||
expect(dir instanceof fs.Dirent).to.be.true();
|
||||
expect(dir).to.be.an.instanceof(fs.Dirent);
|
||||
}
|
||||
const names = dirs.map(a => a.name);
|
||||
expect(names).to.deep.equal(['file1', 'file2', 'file3']);
|
||||
|
@ -941,7 +941,7 @@ describe('asar package', function () {
|
|||
|
||||
const dirs = await promisify(fs.readdir)(p, { withFileTypes: true });
|
||||
for (const dir of dirs) {
|
||||
expect(dir instanceof fs.Dirent).to.be.true();
|
||||
expect(dir).to.be.an.instanceof(fs.Dirent);
|
||||
}
|
||||
|
||||
const names = dirs.map((a: any) => a.name);
|
||||
|
@ -1004,7 +1004,7 @@ describe('asar package', function () {
|
|||
const p = path.join(asarDir, 'a.asar');
|
||||
const dirs = await fs.promises.readdir(p, { withFileTypes: true });
|
||||
for (const dir of dirs) {
|
||||
expect(dir instanceof fs.Dirent).to.be.true();
|
||||
expect(dir).to.be.an.instanceof(fs.Dirent);
|
||||
}
|
||||
const names = dirs.map(a => a.name);
|
||||
expect(names).to.deep.equal(['dir1', 'dir2', 'dir3', 'file1', 'file2', 'file3', 'link1', 'link2', 'ping.js']);
|
||||
|
|
Loading…
Reference in a new issue