diff --git a/package.json b/package.json index 15bc05b..7a432a5 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "prettier": "^3.2.5", "prettier-plugin-ember-template-tag": "^2.0.2", "release-plan": "^0.9.0", + "resolve-bin": "^1.0.1", "strip-ansi": "^7.1.0", "tmp-promise": "^3.0.3", "vitest": "^1.6.0" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 540e3a4..c60f6c6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -45,6 +45,9 @@ importers: release-plan: specifier: ^0.9.0 version: 0.9.0(encoding@0.1.13) + resolve-bin: + specifier: ^1.0.1 + version: 1.0.1 strip-ansi: specifier: ^7.1.0 version: 7.1.0 @@ -1937,6 +1940,9 @@ packages: find-index@1.1.1: resolution: {integrity: sha512-XYKutXMrIK99YMUPf91KX5QVJoG31/OsgftD6YoTPAObfQIxM4ziA9f0J1AsqKhJmo+IeaIPP0CFopTD4bdUBw==} + find-parent-dir@0.3.1: + resolution: {integrity: sha512-o4UcykWV/XN9wm+jMEtWLPlV8RXCZnMhQI6F6OdHeSez7iiJWePw8ijOlskJZMsaQoGR/b7dH6lO02HhaTN7+A==} + find-up@4.1.0: resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} engines: {node: '>=8'} @@ -3460,6 +3466,9 @@ packages: requires-port@1.0.0: resolution: {integrity: sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==} + resolve-bin@1.0.1: + resolution: {integrity: sha512-4G9C3udcDB1c9qaopB+9dygm2bMyF2LeJ2JHBIc24N7ob+UuSSwX3ID1hQwpDEQep9ZRNdhT//rgEd6xbWA/SA==} + resolve-dir@1.0.1: resolution: {integrity: sha512-R7uiTjECzvOsWSfdM0QKFNBVFcK27aHOUwdvK53BcW8zqnGdYp0Fbj82cy54+2A4P2tFM22J5kRfe1R+lM/1yg==} engines: {node: '>=0.10.0'} @@ -6498,6 +6507,8 @@ snapshots: find-index@1.1.1: {} + find-parent-dir@0.3.1: {} + find-up@4.1.0: dependencies: locate-path: 5.0.0 @@ -8116,6 +8127,10 @@ snapshots: requires-port@1.0.0: {} + resolve-bin@1.0.1: + dependencies: + find-parent-dir: 0.3.1 + resolve-dir@1.0.1: dependencies: expand-tilde: 2.0.2 diff --git a/tests/default.test.mjs b/tests/default.test.mjs index 6f72a23..d79d758 100644 --- a/tests/default.test.mjs +++ b/tests/default.test.mjs @@ -5,6 +5,7 @@ import { execa } from 'execa'; import copyWithTemplate from '../lib/copy-with-template'; import { existsSync, writeFileSync } from 'fs'; import stripAnsi from 'strip-ansi'; +import { emberCli } from './helpers.mjs'; const blueprintPath = join(__dirname, '..'); const appName = 'fancy-app-in-test'; @@ -24,7 +25,7 @@ describe('basic functionality', function () { '--skip-git', ]; - await execa('ember', emberCliArgs, { + await execa(emberCli, emberCliArgs, { cwd: tmpDir.path, preferLocal: true, }); diff --git a/tests/helpers.mjs b/tests/helpers.mjs new file mode 100644 index 0000000..412b4c9 --- /dev/null +++ b/tests/helpers.mjs @@ -0,0 +1,7 @@ +import { sync as resolveBinSync } from 'resolve-bin'; + +function findEmber() { + return resolveBinSync('ember-cli', { executable: 'ember' }); +} + +export const emberCli = findEmber();