Skip to content

Commit

Permalink
fix: cli options (#194)
Browse files Browse the repository at this point in the history
  • Loading branch information
ASaiAnudeep authored Jun 3, 2024
1 parent 7fa80bc commit d3a35e2
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "testbeats",
"version": "2.0.3",
"version": "2.0.4",
"description": "Publish test results to Microsoft Teams, Google Chat, Slack and InfluxDB",
"main": "src/index.js",
"types": "./src/index.d.ts",
Expand Down
6 changes: 3 additions & 3 deletions src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ const { PublishCommand } = require('./commands/publish.command');
const logger = require('./utils/logger');

prog
.version('2.0.3')
.option('--config', 'path to config file')
.option('--logLevel', 'Log Level', "INFO")
.version('2.0.4')
.option('-c, --config', 'path to config file')
.option('-l, --logLevel', 'Log Level', "INFO")
.option('--slack', 'slack webhook url')
.option('--teams', 'teams webhook url')
.option('--chat', 'chat webhook url')
Expand Down
9 changes: 9 additions & 0 deletions test/cli.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ describe('CLI', () => {
});
});

it('publish results with alias config param', (done) => {
mock.addInteraction('post test-summary to slack');
exec('node src/cli.js publish -c test/data/configs/slack.config.json', (error, stdout, stderr) => {
console.log(stdout);
assert.match(stdout, /✅ Results published successfully!/);
done();
});
});

it('publish results with config builder', (done) => {
mock.addInteraction('post test-summary to slack');
exec('node src/cli.js publish --slack http://localhost:9393/message --testng test/data/testng/single-suite.xml', (error, stdout, stderr) => {
Expand Down

0 comments on commit d3a35e2

Please sign in to comment.