Skip to content

Commit 2cabec6

Browse files
authored
remove the need for the async NPM package (github#27119)
1 parent 1f034ef commit 2cabec6

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

tests/meta/orphan-tests.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import { statSync } from 'fs'
12
import fs from 'fs/promises'
23
import path from 'path'
3-
import { filter as asyncFilter } from 'async'
44

55
describe('check for orphan tests', () => {
66
test('all tests are in sub-directories', async () => {
@@ -11,14 +11,10 @@ describe('check for orphan tests', () => {
1111
// Get a list of files/directories in `/tests`
1212
const testDirectory = await fs.readdir(pathToTests)
1313

14-
// Filter out our exceptions
15-
let filteredList = testDirectory.filter((item) => !EXCEPTIONS.includes(item))
16-
17-
// Don't include directories
18-
filteredList = await asyncFilter(
19-
filteredList,
20-
async (item) => !(await fs.stat(path.join(pathToTests, item))).isDirectory()
21-
)
14+
// Filter out our exceptions and directories
15+
const filteredList = testDirectory
16+
.filter((item) => !EXCEPTIONS.includes(item))
17+
.filter((item) => !statSync(path.join(pathToTests, item)).isDirectory())
2218

2319
expect(filteredList).toHaveLength(0)
2420
})

0 commit comments

Comments
 (0)