Skip to content

Commit 4b62b11

Browse files
authored
Merge pull request #6 from smallstack/full-cov
2 parents e06b3e8 + 1ca0c10 commit 4b62b11

File tree

5 files changed

+39
-8
lines changed

5 files changed

+39
-8
lines changed

lib/main.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@ export * from "./modules/forms";
22
export * from "./modules/number";
33
export * from "./modules/object";
44
export * from "./modules/string";
5-

lib/modules/forms/schema.utils.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,6 @@ describe("Schema Utils", () => {
6666

6767
expect(getSchemaForPath(schema, "invalid")).toEqual(undefined);
6868
expect(getSchemaForPath(schema, "address.invalid")).toEqual(undefined);
69+
expect(getSchemaForPath({type:"object"}, "address")).toEqual(undefined);
6970
});
7071
});

lib/modules/object/object.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,7 @@ describe("ObjectUtils", () => {
1818
{ removeEmptyArrays: true, removeEmptyObjects: true }
1919
)
2020
).toEqual({});
21+
expect(removeNullish(undefined)).toBeUndefined();
22+
expect(removeNullish({test: ""}, { removeEmptyStrings: true })).toEqual({});
2123
});
2224
});
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { describe, expect, test } from "vitest";
2+
import { upperCaseFirst } from "./string.utils";
3+
4+
describe("upperCaseFirst", () => {
5+
test("should return an empty string when input is an empty string", () => {
6+
expect(upperCaseFirst("")).toBe("");
7+
});
8+
9+
test("should capitalize the first letter of a single character string", () => {
10+
expect(upperCaseFirst("a")).toBe("A");
11+
});
12+
13+
test("should capitalize the first letter of a multiple character string", () => {
14+
expect(upperCaseFirst("hello")).toBe("Hello");
15+
});
16+
17+
test("should return the same string if the first character is already capitalized", () => {
18+
expect(upperCaseFirst("Hello")).toBe("Hello");
19+
});
20+
21+
test("should handle strings with special characters correctly", () => {
22+
expect(upperCaseFirst("!hello")).toBe("!hello");
23+
expect(upperCaseFirst("123hello")).toBe("123hello");
24+
});
25+
26+
test("should handle strings with leading whitespace correctly", () => {
27+
expect(upperCaseFirst(" hello")).toBe(" hello");
28+
});
29+
});

vite.config.mjs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ export default defineConfig({
3434
coverage: {
3535
provider: "v8",
3636
include: ["lib/**"],
37-
exclude: ["node_modules/**"],
37+
exclude: ["node_modules/**", "lib/main.ts", "lib/**/index.ts"],
3838
reporter: ["lcov", "clover", "text-summary"],
3939
reportsDirectory: "coverage",
40-
// thresholds: {
41-
// statements: 100,
42-
// branches: 100,
43-
// functions: 100,
44-
// lines: 100,
45-
// },
40+
thresholds: {
41+
statements: 100,
42+
branches: 100,
43+
functions: 100,
44+
lines: 100,
45+
},
4646
},
4747
},
4848
});

0 commit comments

Comments
 (0)