-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(cli)!: reimplement with
nest-commander
- https://github.com/jmcdo29/nest-commander - removes support for node14 so `assert { type: json }` can be used Signed-off-by: Lexus Drumgold <[email protected]>
- Loading branch information
1 parent
56965d5
commit 9bc1543
Showing
66 changed files
with
4,455 additions
and
625 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ lintstagedrc | |
memfs | ||
mkbuild | ||
mlly | ||
nestjs | ||
nocheck | ||
npmrc | ||
nvmrc | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -284,7 +284,6 @@ jobs: | |
- 19 | ||
- 18 | ||
- 16 | ||
- 14 | ||
steps: | ||
- id: checkout | ||
name: Checkout ${{ env.REF_NAME }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"cleanUrls": true, | ||
"directoryListing": true, | ||
"public": "../coverage/lcov-report", | ||
"trailingSlash": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/** | ||
* @file Test Utilities - createTestingCommand | ||
* @module tests/utils/createTestingCommand | ||
*/ | ||
|
||
import AppModule from '#src/cli/app.module' | ||
import { CLI_NAME } from '#src/cli/constants' | ||
import { Module } from '@nestjs/common' | ||
import type { TestingModule } from '@nestjs/testing' | ||
import { CommandRunnerModule } from 'nest-commander' | ||
import { | ||
CommandTestFactory, | ||
type CommandModuleMetadata | ||
} from 'nest-commander-testing' | ||
|
||
/** | ||
* Creates a CLI command testing module. | ||
* | ||
* @see https://nest-commander.jaymcdoniel.dev/testing/factory | ||
* | ||
* @async | ||
* | ||
* @param {Omit<CommandModuleMetadata, 'imports'>} metadata - Module metadata | ||
* @return {Promise<TestingModule>} CLI command testing module | ||
*/ | ||
const createTestingCommand = async ( | ||
metadata: Omit<CommandModuleMetadata, 'imports'> | ||
): Promise<TestingModule> => { | ||
/** | ||
* Test CLI application module. | ||
* | ||
* @class | ||
*/ | ||
@Module(metadata) | ||
class TestAppModule {} | ||
|
||
return CommandTestFactory.createTestingCommand({ | ||
imports: [ | ||
CommandRunnerModule.forModule(undefined, { | ||
cliName: CLI_NAME, | ||
enablePositionalOptions: true, | ||
errorHandler: AppModule.errorHandler, | ||
pluginsAvailable: false, | ||
serviceErrorHandler: AppModule.serviceErrorHandler, | ||
usePlugins: false | ||
}), | ||
TestAppModule | ||
] | ||
}).compile() | ||
} | ||
|
||
export default createTestingCommand |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.