mirror of
https://github.com/serverless/serverless.git
synced 2025-12-08 19:46:03 +00:00
28 lines
639 B
JavaScript
28 lines
639 B
JavaScript
'use strict';
|
|
|
|
const expect = require('chai').expect;
|
|
const sandbox = require('sinon');
|
|
const logWarning = require('../../../../lib/classes/Error').logWarning;
|
|
|
|
describe('#logWarning()', () => {
|
|
let consoleLogSpy;
|
|
|
|
beforeEach(() => {
|
|
consoleLogSpy = sandbox.spy(console, 'log');
|
|
});
|
|
|
|
afterEach(() => {
|
|
sandbox.restore();
|
|
});
|
|
|
|
it('should log warning and proceed', () => {
|
|
logWarning('a message');
|
|
|
|
const message = consoleLogSpy.args.join('\n');
|
|
|
|
expect(consoleLogSpy.called).to.equal(true);
|
|
expect(message).to.have.string('Serverless Warning');
|
|
expect(message).to.have.string('a message');
|
|
});
|
|
});
|