Skip to content

Commit

Permalink
Modified required-coverage param
Browse files Browse the repository at this point in the history
  • Loading branch information
jdkgabri committed Aug 5, 2022
1 parent bdc1a48 commit d6974ae
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ sfdx force:source:deploy --wait 60 --checkonly --manifest manifest/package.xml -
```

```sh
sfdx nps:coverage:verify --path test-results/results.json --requiredcoverage 90 --classes AccountTriggerHandler,ContactTriggerHandler
sfdx nps:coverage:verify --path test-results/results.json --required-coverage 90 --classes AccountTriggerHandler,ContactTriggerHandler
```

## Getting Started
Expand Down Expand Up @@ -85,7 +85,7 @@ FLAGS
-p, --path=<value> (required) project relative path to
the json file containing the test
execution results
-r, --requiredcoverage=<value> [default: 75] number of the
-r, --required-coverage=<value> [default: 75] number of the
percentage of coverage treshold to
reach
--json format output as json
Expand All @@ -96,10 +96,10 @@ DESCRIPTION
Verifies that specified apex classes have a coverage above a certain treshold
EXAMPLES
$ sfdx coverage:verify --path test-results/results.json --requiredcoverage 90 --classes AccountTriggerHandler,ContactTriggerHandler
$ sfdx coverage:verify --path test-results/results.json --required-coverage 90 --classes AccountTriggerHandler,ContactTriggerHandler
```

_See code: [src/commands/nps/coverage/verify.ts](https://github.com/Nakama-Partnering-Services/nakama-plugin-sfdx/blob/v1.0.0/src/commands/nps/coverage/verify.ts)_
_See code: [src/commands/nps/coverage/verify.ts](https://github.com/Nakama-Partnering-Services/nakama-plugin-sfdx/blob/v1.0.2/src/commands/nps/coverage/verify.ts)_
<!-- commandsstop -->

## Walkthrough
Expand Down
2 changes: 1 addition & 1 deletion messages/verify.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"errorInsufficientCoverageForClasses": "Included apex classes should met at least the required coverage of %s%. Classes without enough coverage: %s",
"noClassesWithInsufficientCoverage": "No classes with insufficient coverage found",
"examples": [
"sfdx coverage:verify --path test-results/results.json --requiredcoverage 90 --classes AccountTriggerHandler,ContactTriggerHandler"
"sfdx coverage:verify --path test-results/results.json --required-coverage 90 --classes AccountTriggerHandler,ContactTriggerHandler"
]
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "nakama-plugin-sfdx",
"description": "This plugin provides commands to work with the coverage files generated by other commands such as sfdx force:source:deploy or sfdx force:apex:test:run",
"version": "1.0.0",
"version": "1.0.2",
"author": "Gabriel Serrano @jdkgabri",
"bugs": "https://github.com/Nakama-Partnering-Services/nakama-plugin-sfdx/issues",
"dependencies": {
Expand Down
10 changes: 5 additions & 5 deletions src/commands/nps/coverage/verify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@ export default class Verify extends SfdxCommand {
path: flags.string({
char: 'p',
description: messages.getMessage('pathToFileFlagDescription'),
required: true,
required: true
}),
requiredcoverage: flags.number({
'required-coverage': flags.number({
char: 'r',
description: messages.getMessage('requiredCoverageFlagDescription'),
default: 75,
default: 75
}),
classes: flags.string({
char: 'c',
description: messages.getMessage('classesToCheckFlagDescription'),
required: true,
required: true
})
};

public async run(): Promise<AnyJson> {
const requiredCoverage = (this.flags.requiredcoverage || 75) as number;
const requiredCoverage = (this.flags['required-coverage'] || 75) as number;

let deploymentResult;
try {
Expand Down

0 comments on commit d6974ae

Please sign in to comment.