diff --git a/src/guitos/domain/uuid.ts b/src/guitos/domain/uuid.ts index 8a29159..0969040 100644 --- a/src/guitos/domain/uuid.ts +++ b/src/guitos/domain/uuid.ts @@ -23,5 +23,10 @@ export class Uuid { `<${this.constructor.name}> does not allow the value <${id}>`, ); } + if (!window.isSecureContext) { + throw new Error( + `<${this.constructor.name}> is not available in a non-secure context`, + ); + } } } diff --git a/src/setupTests.ts b/src/setupTests.ts index e18a310..404eb88 100644 --- a/src/setupTests.ts +++ b/src/setupTests.ts @@ -12,6 +12,7 @@ import * as AppBudgetContext from "./guitos/context/BudgetContext"; import { BudgetMother } from "./guitos/domain/budget.mother"; window.crypto.randomUUID = randomUUID; +window.isSecureContext = true; global.URL.createObjectURL = vi.fn(); vi.mock("crypto", () => ({