From 3b30ee3130bccd30693bc1df17f38e7c6e56947c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Acid=20Chicken=20=28=E7=A1=AB=E9=85=B8=E9=B6=8F=29?= Date: Thu, 1 Jun 2023 08:50:26 +0000 Subject: [PATCH] test: fix vitest --- packages/frontend/src/components/MkImgWithBlurhash.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/frontend/src/components/MkImgWithBlurhash.vue b/packages/frontend/src/components/MkImgWithBlurhash.vue index 3750dacdd..b07617b37 100644 --- a/packages/frontend/src/components/MkImgWithBlurhash.vue +++ b/packages/frontend/src/components/MkImgWithBlurhash.vue @@ -23,6 +23,11 @@ import { WorkerMultiDispatch } from '@/scripts/worker-multi-dispatch'; import { extractAvgColorFromBlurhash } from '@/scripts/extract-avg-color-from-blurhash'; const workerPromise = new Promise(resolve => { + // テスト環境で Web Worker インスタンスは作成できない + if (import.meta.env.MODE === 'test') { + resolve(null); + return; + } const testWorker = new TestWebGL2(); testWorker.addEventListener('message', event => { if (event.data.result) {