Skip to content

Commit

Permalink
Fix flaky test
Browse files Browse the repository at this point in the history
  • Loading branch information
pderaaij committed Oct 15, 2024
1 parent fa1d856 commit 1e0480b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 2 additions & 5 deletions packages/foam-vscode/src/core/model/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,8 @@ export class FoamWorkspace implements IDisposable {

const resources: Resource[] = [];

this._resources.find(needle).forEach(elm => {
if (elm[0].indexOf(getExtension(normalize(identifier))) > 0) {
resources.push(elm[1]);
}
});
this._resources.find(needle).forEach(elm => resources.push(elm[1]));

if (mdNeedle) {
this._resources.find(mdNeedle).forEach(elm => resources.push(elm[1]));
}
Expand Down
4 changes: 4 additions & 0 deletions packages/foam-vscode/src/features/navigation-provider.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,10 @@ describe('Document navigation', () => {
doc,
new vscode.Position(0, 26)
);

// Make sure the references are sorted by position, so we match the right expectation
refs.sort((a, b) => a.range.start.character - b.range.start.character);

expect(refs.length).toEqual(2);
expect(refs[0]).toEqual({
uri: toVsCodeUri(fileB.uri),
Expand Down

0 comments on commit 1e0480b

Please sign in to comment.