Skip to content

Commit

Permalink
Mock npm install in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
medikoo committed Aug 14, 2019
1 parent 60f36e4 commit f0a8b8c
Showing 1 changed file with 6 additions and 2 deletions.
@@ -1,6 +1,9 @@
'use strict';

const expect = require('chai').expect;
const sinon = require('sinon');
const BbPromise = require('bluebird');
const childProcess = BbPromise.promisifyAll(require('child_process'));
const AwsCompileApigEvents = require('../..');
const Serverless = require('../../../../../../../../Serverless');
const AwsProvider = require('../../../../../../provider/awsProvider');
Expand Down Expand Up @@ -194,6 +197,8 @@ describe('#compileStage()', () => {
});

describe('logs', () => {
before(() => sinon.stub(childProcess, 'execAsync'));
after(() => childProcess.execAsync.restore());
beforeEach(() => {
// setting up API Gateway logs
awsCompileApigEvents.serverless.service.provider.logs = {
Expand Down Expand Up @@ -242,8 +247,7 @@ describe('#compileStage()', () => {
});
}));

it('should create a Log Group resource', function() {
this.timeout(30 * 1000);
it('should create a Log Group resource', () => {
return awsCompileApigEvents.compileStage().then(() => {
const resources =
awsCompileApigEvents.serverless.service.provider.compiledCloudFormationTemplate.Resources;
Expand Down

0 comments on commit f0a8b8c

Please sign in to comment.