1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-06 11:43:51 +00:00

Fixup spec types

This commit is contained in:
Matt Gibson
2025-07-10 07:12:36 -07:00
parent 7ece2a992a
commit 5f5e5415fd

View File

@@ -12,7 +12,7 @@ describe("KeyDefinition", () => {
it("throws on undefined deserializer", () => {
expect(() => {
new KeyDefinition<boolean>(fakeStateDefinition, "fake", {
deserializer: undefined,
deserializer: undefined!,
});
});
});
@@ -153,7 +153,7 @@ describe("KeyDefinition", () => {
const deserializedValue = recordDefinition.deserializer({
test1: false,
test2: true,
});
})!;
expect(Object.keys(deserializedValue)).toHaveLength(2);
@@ -174,7 +174,7 @@ describe("KeyDefinition", () => {
const fancyRecord = recordDefinition.deserializer(
JSON.parse(`{ "myKey": false, "mySecondKey": true }`),
);
)!;
expect(fancyRecord).toBeTruthy();
expect(Object.keys(fancyRecord)).toHaveLength(2);
@@ -193,7 +193,7 @@ describe("KeyDefinition", () => {
expect(arrayDefinition.deserializer).toBeTruthy();
// NOTE: `as any` is here until we migrate to Nx: https://bitwarden.atlassian.net/browse/PM-6493
const deserializedValue = arrayDefinition.deserializer([false, true] as any);
const deserializedValue = arrayDefinition.deserializer([false, true] as any)!;
expect(deserializedValue).toBeTruthy();
expect(deserializedValue).toHaveLength(2);