mavensmate
Version:
Core APIs that drive MavensMate IDEs for Salesforce1/Force.com
41 lines (32 loc) • 1.08 kB
JavaScript
;
var assert = require('assert');
var sinon = require('sinon');
var sinonAsPromised = require('sinon-as-promised');
var util = require('../../../../app/lib/util');
var helper = require('../../../test-helper');
var commandExecutor = require('../../../../app/lib/commands')();
sinonAsPromised(require('bluebird'));
describe('mavensmate get-connections-cli', function(){
var program;
var commandExecutorStub;
var getPayloadStub;
before(function() {
program = helper.initCli();
});
beforeEach(function() {
commandExecutorStub = sinon.stub(program.commandExecutor, 'execute');
getPayloadStub = sinon.stub(util, 'getPayload').resolves({ foo : 'bar' });
});
afterEach(function() {
commandExecutorStub.restore();
getPayloadStub.restore();
});
it('should call directly', function(done) {
program._events['get-connections']();
commandExecutorStub.calledOnce.should.equal(true);
assert(commandExecutorStub.calledWithMatch({
name: 'get-connections'
}));
done();
});
});