From 3352727aa638fcfcc6461d2aaded8ef9603acc0d Mon Sep 17 00:00:00 2001 From: ivarlovlie Date: Tue, 4 Oct 2022 00:04:19 +0800 Subject: feat: Initial setup facilitating testing --- apps/kit/src/actions/pwKey.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 apps/kit/src/actions/pwKey.ts (limited to 'apps/kit/src/actions/pwKey.ts') diff --git a/apps/kit/src/actions/pwKey.ts b/apps/kit/src/actions/pwKey.ts new file mode 100644 index 0000000..a2f22e7 --- /dev/null +++ b/apps/kit/src/actions/pwKey.ts @@ -0,0 +1,10 @@ +import { is_development, is_testing } from "$lib/configuration"; + +export default function pwKey(node: HTMLElement, value: string | undefined) { + if (!value) return; + if (!is_testing()) { + if (is_development()) console.warn("VITE_TESTING is false, so not setting pw-key attributes"); + return; + } + node.setAttribute("pw-key", value); +} \ No newline at end of file -- cgit v1.3