Skip to content

Commit

Permalink
add doc and improve testing
Browse files Browse the repository at this point in the history
  • Loading branch information
AjayvirS committed Jan 2, 2025
1 parent 118fd78 commit 297416d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,8 @@ public boolean accept(java.io.File directory, String fileName) {
* Note: This method does not handle changes to the repository content between invocations. If files change
* after the initial caching, the cache does not automatically refresh, which may lead to stale data.
*
* @param repo The repository to scan for files and directories.
* @param repo The repository to scan for files and directories.
* @param omitBinaries do not include binaries to reduce payload size
* @return A {@link Map} where each key is a {@link File} object representing a file or directory, and each value is
* the corresponding {@link FileType} (FILE or FOLDER). The map excludes symbolic links.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,14 @@ describe('ProgrammingExercise Service', () => {
}
functionToCall.bind(service, exerciseId).apply().subscribe();
const url = `${resourceUrl}/${exerciseId}/${test.uri}`;
const req = httpMock.expectOne({ method: 'GET', url });

// Custom matcher function
const urlMatcher = (reqUrl: string) => reqUrl.startsWith(url);

const req = httpMock.expectOne((request) => {
return request.method === 'GET' && urlMatcher(request.url);
});

req.flush({});
tick();
})(),
Expand Down

0 comments on commit 297416d

Please sign in to comment.