Skip to content

Commit 0148018

Browse files
authored
Do not convert version to a number (#10)
1 parent ea54d19 commit 0148018

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "logrocket-cli",
3-
"version": "0.11.0",
3+
"version": "0.12.0",
44
"description": "Command line tool for [LogRocket](https://logrocket.com/).",
55
"main": "index.js",
66
"author": "Logrocket <[email protected]> (https://logrocket.com/)",

src/__specs__/cli.spec.js

+16
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,22 @@ describe('CLI dispatch tests', function cliTests() {
169169
expect(req.body).to.equal('{"version":"1.0.3"}');
170170
}));
171171

172+
it('should not convert the release version to a number', mochaAsync(async () => {
173+
addCliStatusMessage();
174+
addExpectRequest('/v1/orgs/org/apps/app/releases/', { status: 200 });
175+
176+
const result = await executeCommand('release -k org:app:secret --apihost="http://localhost:8818" 81444e2');
177+
178+
expect(result.err).to.be.null();
179+
expect(matchedRequests).to.have.length(2);
180+
expect(unmatchedRequests).to.have.length(0);
181+
182+
const req = matchedRequests[1];
183+
expect(req.method).to.equal('POST');
184+
expect(req.headers).to.have.property('authorization', 'Token org:app:secret');
185+
expect(req.body).to.equal('{"version":"81444e2"}');
186+
}));
187+
172188
it('should ignore duplicate releases', mochaAsync(async () => {
173189
addCliStatusMessage();
174190
addExpectRequest('/v1/orgs/org/apps/app/releases/', { status: 200 });

src/commands/release.js

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export const builder = (args) => {
1111
describe: 'Fail on duplicate releases',
1212
default: false,
1313
})
14+
.string('_')
1415
.demand(1, 'Missing release version: e.g. logrocket release 1.2.3')
1516
.help();
1617
};

0 commit comments

Comments
 (0)