diff --git a/test/support/tests.js b/test/support/tests.js index 8b08abfd2296..3ff28ba810f7 100644 --- a/test/support/tests.js +++ b/test/support/tests.js @@ -274,7 +274,7 @@ export const testBlueprintSupport = (generatorName, options = {}) => { before(async () => { result = await helpers .run(generatorPath) - .withMockedJHipsterGenerators({ exceptFilter: () => true }) + .withMockedJHipsterGenerators({ filter: () => true }) .withMockedGenerators([`jhipster-foo:${generatorName}`]) .withJHipsterConfig() .withOptions({ blueprint: 'foo' }) @@ -301,7 +301,7 @@ export const testBlueprintSupport = (generatorName, options = {}) => { } const context = helpers .run(generatorPath) - .withMockedJHipsterGenerators({ exceptFilter: () => true }) + .withMockedJHipsterGenerators({ filter: () => true }) .withMockedGenerators([`jhipster-foo-sbs:${generatorName}`]) .withJHipsterConfig( {}, diff --git a/testing/helpers.ts b/testing/helpers.ts index fb40435942d3..1b2b4705fccc 100644 --- a/testing/helpers.ts +++ b/testing/helpers.ts @@ -264,14 +264,14 @@ class JHipsterRunContext extends RunContext { * withMockedJHipsterGenerators({ except: ['bootstrap', 'server'] }) * @example * // Mock every generator including bootstrap-* - * withMockedJHipsterGenerators({ exceptFilter: () => true }) + * withMockedJHipsterGenerators({ filter: () => true }) */ - withMockedJHipsterGenerators(options: string[] | { except?: string[]; exceptFilter?: (string) => boolean } = {}): this { + withMockedJHipsterGenerators(options: string[] | { except?: string[]; filter?: (string) => boolean } = {}): this { const optionsObj = Array.isArray(options) ? { except: options } : options; - const { except = [], exceptFilter = filterBootstrapGenerators } = optionsObj; + const { except = [], filter = filterBootstrapGenerators } = optionsObj; const jhipsterExceptList = except.map(gen => (gen.startsWith('jhipster:') ? gen : `jhipster:${gen}`)); return this.withMockedGenerators( - allGenerators.filter(exceptFilter).filter(gen => !jhipsterExceptList.includes(gen) && (this as any).Generator !== gen), + allGenerators.filter(filter).filter(gen => !jhipsterExceptList.includes(gen) && (this as any).Generator !== gen), ); }