From 7ceb0ecbf6eba468d4ab74d06b23f8360eea8acb Mon Sep 17 00:00:00 2001 From: achingbrain Date: Wed, 17 Jan 2024 13:38:27 +0100 Subject: [PATCH] fix: include aegir config in interop and run from install dir Otherwise it can't find the tests. --- packages/interop/package.json | 3 ++- packages/interop/src/bin.ts | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/interop/package.json b/packages/interop/package.json index 699a8248..0327af27 100644 --- a/packages/interop/package.json +++ b/packages/interop/package.json @@ -27,7 +27,8 @@ "src", "dist", "!dist/test", - "!**/*.tsbuildinfo" + "!**/*.tsbuildinfo", + ".aegir.js" ], "exports": { ".": { diff --git a/packages/interop/src/bin.ts b/packages/interop/src/bin.ts index d03f5374..4110b9a3 100644 --- a/packages/interop/src/bin.ts +++ b/packages/interop/src/bin.ts @@ -2,8 +2,15 @@ /* eslint-disable no-console */ import { spawn } from 'node:child_process' +import { dirname, resolve } from 'path' +import { fileURLToPath } from 'url' -const test = spawn('npx', ['aegir', 'test']) +// aegir should be run from `node_modules/@helia/interop` +const cwd = resolve(dirname(fileURLToPath(import.meta.url)), '../../') + +const test = spawn('npx', ['aegir', 'test'], { + cwd +}) test.stdout.on('data', (data) => { process.stdout.write(data)