Skip to content

Commit

Permalink
clear precint.ast before parse new file
Browse files Browse the repository at this point in the history
fix test
  • Loading branch information
GoodDayForSurf committed Oct 23, 2024
1 parent 95928c7 commit ff9b3d5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ export default class DependencyCollector {
if (!filePathInProcess && cacheScriptItem === undefined) {
filePathMap.set(filePath, busyCache);

precinct.ast = [];
const result = precinct.paperwork(filePath, {
es6: { mixedImports: true },
ts: { skipTypeImports : true }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const simpleDependencies: ScriptsDependencyTree = {
widget: '',
},
},
widget: 'datagrid',
widget: '',
},
},
widget: 'datagrid',
Expand Down Expand Up @@ -234,8 +234,6 @@ describe('DependencyCollector', () => {
const dependencyCollector = new DependencyCollector();
const fullDependencyTree = dependencyCollector.getFullDependencyTree('dx.all.js');

console.log('---------fullDependencyTree->', JSON.stringify(fullDependencyTree));
console.log('---------simpleDependencies->', JSON.stringify(simpleDependencies));
expect(fullDependencyTree).toEqual(simpleDependencies);
});

Expand Down

0 comments on commit ff9b3d5

Please sign in to comment.