fix: correct package scope name
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -2,3 +2,4 @@ node_modules
|
|||||||
*.d.ts
|
*.d.ts
|
||||||
.vitest-attachments
|
.vitest-attachments
|
||||||
__screenshots__
|
__screenshots__
|
||||||
|
tasks
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "@heliospolis/js",
|
"name": "@heliopolis/js",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|||||||
@@ -56,6 +56,23 @@ describe("NonEmptyString", () => {
|
|||||||
).success,
|
).success,
|
||||||
).toBe(false));
|
).toBe(false));
|
||||||
|
|
||||||
|
it("trims leading and trailing whitespace from valid strings", {
|
||||||
|
repeats: 10,
|
||||||
|
}, () => {
|
||||||
|
const content = faker.string.alphanumeric({ length: { min: 1, max: 255 } });
|
||||||
|
|
||||||
|
expect(NonEmptyString.safeDecode(` \n\t${content}\t\n `)).toStrictEqual({
|
||||||
|
data: content,
|
||||||
|
success: true,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it.each([".", "hello world", "déjà vu", "こんにちは", "🚀"])(
|
||||||
|
"accepts non-empty non-alphanumeric content: %s",
|
||||||
|
(content) =>
|
||||||
|
expect(NonEmptyString.safeDecode(content).success).toBe(true),
|
||||||
|
);
|
||||||
|
|
||||||
it("accepts strings with at least 1 non-whitespsace character", () =>
|
it("accepts strings with at least 1 non-whitespsace character", () =>
|
||||||
expect(
|
expect(
|
||||||
NonEmptyString.safeDecode(
|
NonEmptyString.safeDecode(
|
||||||
|
|||||||
Reference in New Issue
Block a user