Skip to content

Commit 85934d9

Browse files
committed
Fix coverage
1 parent 722f03b commit 85934d9

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

lib/modules/string/string.utils.test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { describe, expect, test } from "vitest";
22
import {
33
camelCaseToSnakeCase,
4+
getTimeAsCharacters,
45
lowerCaseFirst,
56
snakeCaseToCamelCase,
67
upperCaseFirst,
@@ -36,6 +37,7 @@ describe("upperCaseFirst", () => {
3637
describe("lowerCaseFirst", () => {
3738
test("should return an empty string when input is an empty string", () => {
3839
expect(lowerCaseFirst("")).toBe("");
40+
expect(lowerCaseFirst(undefined as any)).toBe(undefined);
3941
});
4042

4143
test("should lowercase the first letter of a single character string", () => {
@@ -93,3 +95,10 @@ describe("snakeCaseToCamelCase", () => {
9395
expect(snakeCaseToCamelCase(" hello_world")).toBe(" helloWorld");
9496
});
9597
});
98+
99+
describe("getTimeAsCharacters", () => {
100+
test("should return a string based on the given timestamp", () => {
101+
const timestamp = 1732608080598;
102+
expect(getTimeAsCharacters(timestamp)).toBe("bhdcgaiaiafji");
103+
});
104+
});

vite.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export default defineConfig({
3434
coverage: {
3535
provider: "v8",
3636
include: ["lib/**"],
37-
exclude: ["node_modules/**", "lib/main.ts", "lib/**/index.ts"],
37+
exclude: ["node_modules/**", "lib/main.ts", "lib/**/index.ts", "lib/**/*.test.ts"],
3838
reporter: ["lcov", "clover", "text-summary"],
3939
reportsDirectory: "coverage",
4040
thresholds: {

0 commit comments

Comments
 (0)