@@ -29,39 +29,33 @@ describe('createDependencyGraph()', async () => {
2929 return path . resolve ( testingDiretctory , relativePath ) ;
3030 } ;
3131
32- it . sequential (
33- 'should resolve dependents when there are circular dependencies' ,
34- async ( ) => {
35- expect ( resolveDependentsOf ( toAbsolute ( 'file-a.ts' ) ) ) . toEqual ( [
36- toAbsolute ( 'file-b.ts' ) ,
37- toAbsolute ( 'general-importing-file.ts' ) ,
38- ] ) ;
39- } ,
40- ) ;
32+ it . sequential ( 'should resolve dependents when there are circular dependencies' , async ( ) => {
33+ expect ( resolveDependentsOf ( toAbsolute ( 'file-a.ts' ) ) ) . toEqual ( [
34+ toAbsolute ( 'file-b.ts' ) ,
35+ toAbsolute ( 'general-importing-file.ts' ) ,
36+ ] ) ;
37+ } ) ;
4138
42- it . sequential (
43- 'should have the right initial value for the dependency graph' ,
44- ( ) => {
45- const relativePathDependencyGraph = Object . fromEntries (
46- Object . entries ( dependencyGraph ) . map ( ( [ key , value ] ) => {
47- return [
48- path . relative ( testingDiretctory , key ) ,
49- {
50- path : path . relative ( testingDiretctory , value . path ) ,
51- dependentPaths : value . dependentPaths . map ( ( p ) =>
52- path . relative ( testingDiretctory , p ) ,
53- ) ,
54- dependencyPaths : value . dependencyPaths . map ( ( p ) =>
55- path . relative ( testingDiretctory , p ) ,
56- ) ,
57- moduleDependencies : value . moduleDependencies ,
58- } ,
59- ] ;
60- } ) ,
61- ) ;
62- expect ( relativePathDependencyGraph ) . toMatchSnapshot ( ) ;
63- } ,
64- ) ;
39+ it . sequential ( 'should have the right initial value for the dependency graph' , ( ) => {
40+ const relativePathDependencyGraph = Object . fromEntries (
41+ Object . entries ( dependencyGraph ) . map ( ( [ key , value ] ) => {
42+ return [
43+ path . relative ( testingDiretctory , key ) ,
44+ {
45+ path : path . relative ( testingDiretctory , value . path ) ,
46+ dependentPaths : value . dependentPaths . map ( ( p ) =>
47+ path . relative ( testingDiretctory , p ) ,
48+ ) ,
49+ dependencyPaths : value . dependencyPaths . map ( ( p ) =>
50+ path . relative ( testingDiretctory , p ) ,
51+ ) ,
52+ moduleDependencies : value . moduleDependencies ,
53+ } ,
54+ ] ;
55+ } ) ,
56+ ) ;
57+ expect ( relativePathDependencyGraph ) . toMatchSnapshot ( ) ;
58+ } ) ;
6559
6660 it . sequential ( 'should work when adding a new file' , async ( ) => {
6761 await fs . writeFile (
0 commit comments