Skip to content

Commit

Permalink
drop quibble dependency (#27610)
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima authored Oct 17, 2024
1 parent b1ab9df commit 3e226f3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 15 deletions.
5 changes: 2 additions & 3 deletions cli/cli.spec.mts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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 = {}) => {
Expand All @@ -105,7 +104,7 @@ describe('cli', () => {
};
});
after(() => {
quibble.reset();
esmocha.reset();
});

beforeEach(async () => {
Expand Down
15 changes: 5 additions & 10 deletions generators/java/support/checks/check-java.spec.ts
Original file line number Diff line number Diff line change
@@ -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: '',
Expand All @@ -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();
});
Expand All @@ -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([]);
});
Expand All @@ -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([]);
});
Expand All @@ -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');
Expand Down
1 change: 0 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@
"jsdoc": "4.0.3",
"open-cli": "8.0.0",
"prettier2": "npm:[email protected]",
"quibble": "0.9.2",
"rimraf": "5.0.7",
"sinon": "19.0.2",
"sinon-chai": "3.7.0",
Expand Down

0 comments on commit 3e226f3

Please sign in to comment.