From 55aba232438b39c4b3c1cfde8319de74b81f81c9 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Sat, 26 Oct 2024 17:11:41 +0100 Subject: [PATCH] test: add test for importing code into a worker --- playground/package.json | 3 ++- playground/workers/test.ts | 7 ++++++- pnpm-lock.yaml | 10 +++++++++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/playground/package.json b/playground/package.json index b09c372..1fb20a8 100644 --- a/playground/package.json +++ b/playground/package.json @@ -7,7 +7,8 @@ "build": "nuxi build", "generate": "nuxi generate" }, - "devDependencies": { + "dependencies": { + "date-fns": "^4.1.0", "nuxt": "3.13.2", "nuxt-workers": "latest" } diff --git a/playground/workers/test.ts b/playground/workers/test.ts index 9265124..72a4043 100644 --- a/playground/workers/test.ts +++ b/playground/workers/test.ts @@ -1,3 +1,8 @@ +import { isSameMinute } from 'date-fns' + export function hi() { - return 'Hello from worker!' + const date = new Date() + if (isSameMinute(date, date)) { + return 'Hello from worker!' + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b0bd553..84d1087 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -91,7 +91,10 @@ importers: version: 3.5.12(typescript@5.6.3) playground: - devDependencies: + dependencies: + date-fns: + specifier: ^4.1.0 + version: 4.1.0 nuxt: specifier: 3.13.2 version: 3.13.2(@parcel/watcher@2.4.1)(@types/node@22.7.5)(eslint@9.12.0(jiti@2.3.3))(ioredis@5.4.1)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.24.0)(terser@5.34.1)(typescript@5.6.3)(vite@5.4.9(@types/node@22.7.5)(terser@5.34.1)) @@ -2163,6 +2166,9 @@ packages: csstype@3.1.3: resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} + date-fns@4.1.0: + resolution: {integrity: sha512-Ukq0owbQXxa/U3EGtsdVBkR1w7KOQ5gIBqdH2hkvknzZPYvBxb/aa6E8L7tmjFtkwZBu3UXBbjIgPo/Ez4xaNg==} + db0@0.1.4: resolution: {integrity: sha512-Ft6eCwONYxlwLjBXSJxw0t0RYtA5gW9mq8JfBXn9TtC0nDPlqePAhpv9v4g9aONBi6JI1OXHTKKkUYGd+BOrCA==} peerDependencies: @@ -6787,6 +6793,8 @@ snapshots: csstype@3.1.3: {} + date-fns@4.1.0: {} + db0@0.1.4: {} debug@2.6.9: -- 2.51.2