-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLI arguments made order invariant #81
Changes from all commits
b4736b4
e0a1c4b
6b6b061
f9f34b6
53577b6
ee535e5
ae6438e
74e6afd
a2b0a49
15b87af
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"env": { | ||
"browser": false, | ||
"node": true | ||
}, | ||
"parserOptions": { | ||
"ecmaVersion": 2017 | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
FROM node:10-alpine | ||
ARG CLI_VERSION=0.0.6 | ||
ARG CLI_VERSION=0.0.7 | ||
RUN yarn global add @soluto-asurion/kamus-cli@${CLI_VERSION} | ||
|
||
ENTRYPOINT ["kamus-cli"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
var fs = require('fs'); | ||
const fs = require('fs'); | ||
|
||
var isDocker; | ||
let isDocker; | ||
|
||
function hasDockerEnv() { | ||
try { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,9 +2,9 @@ const expect = require('chai').expect; | |
const nock = require('nock'); | ||
const sinon = require('sinon'); | ||
|
||
const encrypt = require('../actions/encrypt.js'); | ||
const encrypt = require('../actions/encrypt'); | ||
|
||
const logger = | ||
const logger = | ||
{ | ||
info: sinon.spy(), | ||
error: console.error, | ||
|
@@ -17,16 +17,19 @@ const data = 'super-secret'; | |
const serviceAccount = 'dummy'; | ||
const namespace = 'team-a'; | ||
|
||
let kamusApiScope; | ||
|
||
describe('Encrypt', () => { | ||
beforeEach(() => { | ||
sinon.stub(process, 'exit'); | ||
nock(kamusUrl) | ||
.post('/api/v1/encrypt', { data, "service-account": serviceAccount, namespace}) | ||
kamusApiScope = nock(kamusUrl) | ||
.post('/api/v1/encrypt', { data, ['service-account']: serviceAccount, namespace}) | ||
.reply(200, '123ABC'); | ||
}); | ||
|
||
it('Should return encrypted data', async () => { | ||
await encrypt({data, serviceAccount, namespace}, {kamusUrl}, logger); | ||
await encrypt(null, {data, serviceAccount, namespace, kamusUrl}, logger); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why null is added here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
expect(kamusApiScope.isDone()).to.be.true; | ||
expect(process.exit.called).to.be.true; | ||
expect(process.exit.calledWith(0)).to.be.true; | ||
expect(logger.info.lastCall.lastArg).to.equal('Encrypted data:\n123ABC') | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer to keep it shorter -
kamus-url