Skip to content

Commit 7809fcd

Browse files
committed
style(resolveConfig): add "filename" to logs
1 parent 4d9de37 commit 7809fcd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/mongodb-memory-server-core/src/util/resolveConfig.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,12 @@ let packageJsonConfig: Record<string, string> = {};
4747
*/
4848
export function findPackageJson(directory?: string): Record<string, string> {
4949
for (const found of finder(directory || process.cwd()) as CustomFinderIterator) {
50-
log(`findPackageJson: Found package.json"`);
50+
// This is an hidden property, using this because an "for..of" loop dosnt return the "filename" value that is besides the "done" and "value" value
51+
const filename = found.__path as string;
52+
log(`findPackageJson: Found package.json at "${filename}"`);
5153

5254
if (Object.keys(found?.config?.mongodbMemoryServer ?? {}).length > 0) {
53-
log(`findPackageJson: Found package with non-empty config field"`);
55+
log(`findPackageJson: Found package with non-empty config field at "${filename}"`);
5456

5557
// the optional chaining is needed, because typescript wont accept an "isNullOrUndefined" in the if with "&& Object.keys"
5658
packageJsonConfig = found?.config?.mongodbMemoryServer;

0 commit comments

Comments
 (0)