Skip to content

Commit

Permalink
fix: errors
Browse files Browse the repository at this point in the history
  • Loading branch information
SychO9 committed Mar 29, 2024
1 parent f886767 commit e77f416
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
1 change: 0 additions & 1 deletion boilerplate/stubs/backend/handler/handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ public function __construct(<% if (locals.repositoryClassName) { %>
<% } %><% if (locals.validatorClassName) { %>
protected <%= validatorClassName %> $validator;
<% } %>) {
<%- dependencies.map(item => `$this->${item[1]} = $${item[1]};`).join("\n\t\t") %>
}

public function handle(<%= handlerCommandClassName %> $command)
Expand Down
4 changes: 2 additions & 2 deletions src/boilersmith/step-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export class StepManager<Providers extends DefaultProviders> {
}
}

async run(paths: Paths, io: IO, providers: Providers, dry = false, args: Record<string, unknown>): Promise<StepsResult> {
async run(paths: Paths, io: IO, providers: Providers, dry = false, args: Record<string, unknown> = {}): Promise<StepsResult> {
if (dry && this.steps.some((s) => !(s instanceof AtomicStepManager) && !s.step.composable)) {
throw new Error('Cannot dry run, as this step manager has non-composable steps.');
}
Expand Down Expand Up @@ -356,7 +356,7 @@ export class AtomicStepManager<Providers = DefaultProviders> extends StepManager
throw new Error("Atomic groups can't be nested.");
}

async run(paths: Paths, io: IO, providers: Providers, dry = false, args: Record<string, unknown>): Promise<StepsResult> {
async run(paths: Paths, io: IO, providers: Providers, dry = false, args: Record<string, unknown> = {}): Promise<StepsResult> {
let fs = createMemFs();

const checkAndRun = async (step: StoredStep<Providers>, packagePath?: string, firstStep = false) => {
Expand Down
2 changes: 1 addition & 1 deletion test/boilersmith/step-manager.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ describe('Step Manager Execution', function () {
});

test('can dry run on StepManager', async function () {
const results = await new StepManager().step(stubStepFactory('Step 1')).step(stubStepFactory('Step 2')).run(paths, io, {}, true);
const results = await new StepManager().step(stubStepFactory('Step 1')).step(stubStepFactory('Step 2')).run(paths, io, {}, true, {});

expect(results.stepsRan).toStrictEqual(['Step 1', 'Step 2']);

Expand Down
2 changes: 2 additions & 0 deletions test/steps/generate/stubs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,14 @@ const backendTestSpecs: StubTest[] = [
className: 'PotatoResource',
modelClass: '\\Flarum\\Potato\\Potato',
modelClassName: 'Potato',
modelType: 'potatoes',
},
expectedExposedParamsRequestedDir: {
class: 'Flarum\\Demo\\somePath\\PotatoResource',
className: 'PotatoResource',
modelClass: '\\Flarum\\Potato\\Potato',
modelClassName: 'Potato',
modelType: 'potatoes',
},
},

Expand Down

0 comments on commit e77f416

Please sign in to comment.