File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change
1
+ import { statSync } from 'fs'
1
2
import fs from 'fs/promises'
2
3
import path from 'path'
3
- import { filter as asyncFilter } from 'async'
4
4
5
5
describe ( 'check for orphan tests' , ( ) => {
6
6
test ( 'all tests are in sub-directories' , async ( ) => {
@@ -11,14 +11,10 @@ describe('check for orphan tests', () => {
11
11
// Get a list of files/directories in `/tests`
12
12
const testDirectory = await fs . readdir ( pathToTests )
13
13
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 ( ) )
22
18
23
19
expect ( filteredList ) . toHaveLength ( 0 )
24
20
} )
You can’t perform that action at this time.
0 commit comments