mirror of
https://github.com/serverless/serverless.git
synced 2026-01-25 15:07:39 +00:00
Add tests
This commit is contained in:
parent
ec9538127d
commit
9ffde98f28
@ -147,5 +147,20 @@ describe('Platform', () => {
|
||||
expect(console.log.calledWithExactly(url)).to.be.equal(true);
|
||||
});
|
||||
});
|
||||
|
||||
it('should skip publishing if user opted out via "publish" config', () => {
|
||||
platform.serverless.service.service = 'new-service-2';
|
||||
platform.serverless.service.serviceObject = {
|
||||
name: 'new-service-2',
|
||||
publish: false,
|
||||
};
|
||||
|
||||
return platform.publishService().then(() => {
|
||||
expect(getAuthTokenStub.calledOnce).to.be.equal(true);
|
||||
expect(getAccountIdStub.calledOnce).to.be.equal(false);
|
||||
expect(endpointsRequestStub.calledOnce).to.be.equal(false);
|
||||
expect(publishServiceRequestStub.calledOnce).to.be.equal(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
18
lib/utils/selectors/selectServicePublish.test.js
Normal file
18
lib/utils/selectors/selectServicePublish.test.js
Normal file
@ -0,0 +1,18 @@
|
||||
'use strict';
|
||||
|
||||
const expect = require('chai').expect;
|
||||
const selectServicePublish = require('./selectServicePublish');
|
||||
|
||||
describe('#selectServicePublish()', () => {
|
||||
it('should return the publish value of the service object', () => {
|
||||
const service = {
|
||||
serviceObject: {
|
||||
publish: true,
|
||||
},
|
||||
};
|
||||
|
||||
const result = selectServicePublish(service);
|
||||
|
||||
expect(result).to.equal(true);
|
||||
});
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user