mirror of
https://github.com/serverless/serverless.git
synced 2026-01-25 15:07:39 +00:00
commit
aba4e09c7b
@ -51,9 +51,9 @@ class AwsPackage {
|
||||
* Outer lifecycle hooks
|
||||
*/
|
||||
'package:cleanup': () =>
|
||||
BbPromise.bind(this)
|
||||
.then(() => this.serverless.pluginManager.spawn('aws:common:validate'))
|
||||
.then(() => this.serverless.pluginManager.spawn('aws:common:cleanupTempDir')),
|
||||
BbPromise.bind(this).then(() =>
|
||||
this.serverless.pluginManager.spawn('aws:common:cleanupTempDir')
|
||||
),
|
||||
|
||||
'package:initialize': () => BbPromise.bind(this).then(this.generateCoreTemplate),
|
||||
|
||||
|
||||
@ -109,16 +109,12 @@ describe('AwsPackage', () => {
|
||||
});
|
||||
|
||||
it('should run "package:cleanup" hook', () => {
|
||||
const spawnAwsCommonValidateStub = spawnStub.withArgs('aws:common:validate').resolves();
|
||||
const spawnAwsCommonCleanupTempDirStub = spawnStub
|
||||
.withArgs('aws:common:cleanupTempDir')
|
||||
.resolves();
|
||||
|
||||
return awsPackage.hooks['package:cleanup']().then(() => {
|
||||
expect(spawnAwsCommonValidateStub.calledOnce).to.equal(true);
|
||||
expect(spawnAwsCommonCleanupTempDirStub.calledAfter(spawnAwsCommonValidateStub)).to.equal(
|
||||
true
|
||||
);
|
||||
expect(spawnAwsCommonCleanupTempDirStub.calledOnce).to.equal(true);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user