mirror of
https://github.com/softprops/action-gh-release.git
synced 2025-05-10 02:44:19 +00:00
feat: add support for release assets with multiple spaces within the name (#518)
* extracted the asset name alignment to utils, added unit tests * fixed formatting issues
This commit is contained in:
parent
b019a5bbb6
commit
98daca21d1
3 changed files with 23 additions and 2 deletions
|
@ -6,6 +6,7 @@ import {
|
|||
parseInputFiles,
|
||||
unmatchedPatterns,
|
||||
uploadUrl,
|
||||
alignAssetName,
|
||||
} from "../src/util";
|
||||
import * as assert from "assert";
|
||||
|
||||
|
@ -368,4 +369,20 @@ describe("util", () => {
|
|||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe("replaceSpacesWithDots", () => {
|
||||
it("replaces all spaces with dots", () => {
|
||||
expect(alignAssetName("John Doe.bla")).toBe("John.Doe.bla");
|
||||
});
|
||||
|
||||
it("handles names with multiple spaces", () => {
|
||||
expect(alignAssetName("John William Doe.bla")).toBe(
|
||||
"John.William.Doe.bla",
|
||||
);
|
||||
});
|
||||
|
||||
it("returns the same string if there are no spaces", () => {
|
||||
expect(alignAssetName("JohnDoe")).toBe("JohnDoe");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue