Skip to content

Commit 48e1c4f

Browse files
committed
improve coverage
1 parent 245877f commit 48e1c4f

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

src/commands/crashlytics-sourcemap-upload.spec.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,12 @@ describe("crashlytics:sourcemap:upload", () => {
8888

8989
it("should find and upload mapping files in a directory", async () => {
9090
await command.runner()(DIR_PATH, { app: "test-app" });
91-
expect(gcsMock.uploadObject).to.be.calledOnce;
91+
expect(gcsMock.uploadObject).to.be.calledTwice;
9292
expect(gcsMock.uploadObject.firstCall.args[0].file).to.match(
9393
/test-app-default-src-test-fixtures-mapping-files-mock_mapping\.js\.map\.zip/,
9494
);
95+
expect(gcsMock.uploadObject.secondCall.args[0].file).to.match(
96+
/test-app-default-src-test-fixtures-mapping-files-subdir-subdir_mock_mapping\.js\.map\.zip/,
97+
);
9598
});
9699
});

src/commands/crashlytics-sourcemap-upload.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export const command = new Command("crashlytics:sourcemap:upload <mappingFiles>"
5858
} else if (fstat.isDirectory()) {
5959
logLabeledBullet("crashlytics", "Looking for mapping files in your directory...");
6060
const files = (
61-
await readdirRecursive({ path: filePath, ignore: ["node_modules", ".git"] })
61+
await readdirRecursive({ path: filePath, ignore: ["node_modules", ".git"], maxDepth: 20 })
6262
).filter((f) => f.name.endsWith(".js.map"));
6363
for (const file of files) {
6464
await uploadMap(file.name, bucketName, appVersion, options);

src/test/fixtures/mapping-files/subdir/subdir_mock_mapping.js.map

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)