Skip to content

Commit 8034051

Browse files
Update content/recipes/nest-commander.md
1 parent c1bc603 commit 8034051

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

content/recipes/nest-commander.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ And that's it. Under the hood, `CommandFactory` will worry about calling `NestFa
5656
5757
So what's the use of writing a super awesome command line script if you can't test it super easily, right? Fortunately, `nest-commander` has some utilities you can make use of that fits in perfectly with the NestJS ecosystem, it'll feel right at home to any Nestlings out there. Instead of using the `CommandFactory` for building the command in test mode, you can use `CommandTestFactory` and pass in your metadata, very similarly to how `Test.createTestingModule` from `@nestjs/testing` works. In fact, it uses this package under the hood. You're also still able to chain on the `overrideProvider` methods before calling `compile()` so you can swap out DI pieces right in the test.
5858
59-
#### Putting it All Together
59+
#### Putting it all together
6060
6161
The following class would equate to having a CLI command that can take in the subcommand `basic` or be called directly, with `-n`, `-s`, and `-b` (along with their long flags) all being supported and with custom parsers for each option. The `--help` flag is also supported, as is customary with commander.
6262

0 commit comments

Comments
 (0)