Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": "changeset version && pnpm install --no-frozen-lockfile && pnpm lint:fix"
},
"devDependencies": {
"@biomejs/biome": "2.3.3",
"@biomejs/biome": "2.3.10",
"@changesets/cli": "2.29.7",
"@types/node": "22.14.1",
"@types/react": "19.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,39 +29,33 @@ describe('createDependencyGraph()', async () => {
return path.resolve(testingDiretctory, relativePath);
};

it.sequential(
'should resolve dependents when there are circular dependencies',
async () => {
expect(resolveDependentsOf(toAbsolute('file-a.ts'))).toEqual([
toAbsolute('file-b.ts'),
toAbsolute('general-importing-file.ts'),
]);
},
);
it.sequential('should resolve dependents when there are circular dependencies', async () => {
expect(resolveDependentsOf(toAbsolute('file-a.ts'))).toEqual([
toAbsolute('file-b.ts'),
toAbsolute('general-importing-file.ts'),
]);
});

it.sequential(
'should have the right initial value for the dependency graph',
() => {
const relativePathDependencyGraph = Object.fromEntries(
Object.entries(dependencyGraph).map(([key, value]) => {
return [
path.relative(testingDiretctory, key),
{
path: path.relative(testingDiretctory, value.path),
dependentPaths: value.dependentPaths.map((p) =>
path.relative(testingDiretctory, p),
),
dependencyPaths: value.dependencyPaths.map((p) =>
path.relative(testingDiretctory, p),
),
moduleDependencies: value.moduleDependencies,
},
];
}),
);
expect(relativePathDependencyGraph).toMatchSnapshot();
},
);
it.sequential('should have the right initial value for the dependency graph', () => {
const relativePathDependencyGraph = Object.fromEntries(
Object.entries(dependencyGraph).map(([key, value]) => {
return [
path.relative(testingDiretctory, key),
{
path: path.relative(testingDiretctory, value.path),
dependentPaths: value.dependentPaths.map((p) =>
path.relative(testingDiretctory, p),
),
dependencyPaths: value.dependencyPaths.map((p) =>
path.relative(testingDiretctory, p),
),
moduleDependencies: value.moduleDependencies,
},
];
}),
);
expect(relativePathDependencyGraph).toMatchSnapshot();
});

it.sequential('should work when adding a new file', async () => {
await fs.writeFile(
Expand Down
Loading
Loading