diff --git a/cli/cli.spec.mts b/cli/cli.spec.mts index be8959e38cfc..75ed978ed3ae 100644 --- a/cli/cli.spec.mts +++ b/cli/cli.spec.mts @@ -8,7 +8,6 @@ import { execaCommandSync } from 'execa'; import type { GeneratorMeta } from '@yeoman/types'; import type FullEnvironment from 'yeoman-environment'; import { coerce } from 'semver'; -import quibble from 'quibble'; import { defaultHelpers as helpers, createBlueprintFiles } from '../lib/testing/index.js'; import { getCommand as actualGetCommonand } from './utils.mjs'; @@ -96,7 +95,7 @@ describe('cli', () => { let argv; before(async () => { - await quibble.esm('./utils.mjs', { logger, getCommand, CLI_NAME: 'jhipster', done: () => {} }); + await esmocha.mock('./utils.mjs', { logger, getCommand, CLI_NAME: 'jhipster', done: () => {} } as any); const { buildJHipster } = await import('./program.mjs'); mockCli = async (argv: string[], opts = {}) => { @@ -105,7 +104,7 @@ describe('cli', () => { }; }); after(() => { - quibble.reset(); + esmocha.reset(); }); beforeEach(async () => { diff --git a/generators/java/support/checks/check-java.spec.ts b/generators/java/support/checks/check-java.spec.ts index abc3ec1f31cd..49576d5634b4 100644 --- a/generators/java/support/checks/check-java.spec.ts +++ b/generators/java/support/checks/check-java.spec.ts @@ -1,7 +1,6 @@ import { after, before, describe, esmocha, expect, it, resetAllMocks } from 'esmocha'; -import quibble from 'quibble'; -const execa = { execa: esmocha.fn(), execaSync: esmocha.fn(), execaCommandSync: esmocha.fn(), execaCommand: esmocha.fn() }; +const { execaCommandSync } = await esmocha.mock('execa', import('execa')); const baseResult = { cwd: '', @@ -15,13 +14,9 @@ const baseResult = { } as any; describe('generator - server - checkJava', () => { - before(async () => { - await quibble.esm('execa', execa); - }); after(() => { - quibble.reset(); + esmocha.reset(); }); - afterEach(() => { resetAllMocks(); }); @@ -31,7 +26,7 @@ describe('generator - server - checkJava', () => { let result; before(async () => { - execa.execaCommandSync.mockReturnValue({ ...baseResult, stderr }); + execaCommandSync.mockReturnValue({ ...baseResult, stderr }); const { default: checkJava } = await import('./check-java.js'); result = checkJava([]); }); @@ -50,7 +45,7 @@ describe('generator - server - checkJava', () => { let result; before(async () => { - execa.execaCommandSync.mockReturnValue({ ...baseResult, exitCode, stderr }); + execaCommandSync.mockReturnValue({ ...baseResult, exitCode, stderr }); const { default: checkJava } = await import('./check-java.js'); result = checkJava([]); }); @@ -64,7 +59,7 @@ describe('generator - server - checkJava', () => { let result; before(async () => { - execa.execaCommandSync.mockImplementation(() => { + execaCommandSync.mockImplementation(() => { throw new Error('foo'); }); const { default: checkJava } = await import('./check-java.js'); diff --git a/package-lock.json b/package-lock.json index 4cb8bb200c22..0183637b45c8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -85,7 +85,6 @@ "jsdoc": "4.0.3", "open-cli": "8.0.0", "prettier2": "npm:prettier@2.8.8", - "quibble": "0.9.2", "rimraf": "5.0.7", "sinon": "19.0.2", "sinon-chai": "3.7.0", diff --git a/package.json b/package.json index cdde1d606c56..b221fa83e0d6 100644 --- a/package.json +++ b/package.json @@ -193,7 +193,6 @@ "jsdoc": "4.0.3", "open-cli": "8.0.0", "prettier2": "npm:prettier@2.8.8", - "quibble": "0.9.2", "rimraf": "5.0.7", "sinon": "19.0.2", "sinon-chai": "3.7.0",