mirror of
https://github.com/serverless/serverless.git
synced 2026-01-25 15:07:39 +00:00
This commit is contained in:
parent
4252422a94
commit
de4aee3f25
@ -134,10 +134,9 @@ module.exports = {
|
||||
// create hashes for all the zip files
|
||||
const zipFiles = globby.sync(['**.zip'], { cwd: serverlessDirPath, dot: true, silent: true });
|
||||
if (this.serverless.service.package.artifact) {
|
||||
const arficatPath = path.join(serverlessDirPath, this.serverless.service.package.artifact);
|
||||
zipFiles.push(arficatPath);
|
||||
zipFiles.push(this.serverless.service.package.artifact);
|
||||
}
|
||||
const zipFilePaths = zipFiles.map(zipFile => path.join(serverlessDirPath, zipFile));
|
||||
const zipFilePaths = zipFiles.map(zipFile => path.resolve(serverlessDirPath, zipFile));
|
||||
|
||||
const readFile = BbPromise.promisify(fs.readFile);
|
||||
const zipFileHashesPromises = zipFilePaths.map(zipFilePath =>
|
||||
|
||||
@ -308,7 +308,7 @@ describe('checkForChanges', () => {
|
||||
silent: true,
|
||||
});
|
||||
expect(readFileStub).to.have.been.calledWith(
|
||||
path.join('my-service/.serverless/my-service.zip')
|
||||
path.resolve(awsDeploy.serverless.config.servicePath, '.serverless/my-service.zip')
|
||||
);
|
||||
expect(awsDeploy.serverless.service.provider.shouldNotDeploy).to.equal(undefined);
|
||||
});
|
||||
@ -351,7 +351,7 @@ describe('checkForChanges', () => {
|
||||
silent: true,
|
||||
});
|
||||
expect(readFileStub).to.have.been.calledWith(
|
||||
path.join('my-service/.serverless/my-service.zip')
|
||||
path.resolve(awsDeploy.serverless.config.servicePath, '.serverless/my-service.zip')
|
||||
);
|
||||
expect(awsDeploy.serverless.service.provider.shouldNotDeploy).to.equal(undefined);
|
||||
});
|
||||
@ -389,7 +389,7 @@ describe('checkForChanges', () => {
|
||||
silent: true,
|
||||
});
|
||||
expect(readFileStub).to.have.been.calledWith(
|
||||
path.join('my-service/.serverless/my-service.zip')
|
||||
path.resolve(awsDeploy.serverless.config.servicePath, '.serverless/my-service.zip')
|
||||
);
|
||||
expect(awsDeploy.serverless.service.provider.shouldNotDeploy).to.equal(undefined);
|
||||
});
|
||||
@ -432,8 +432,12 @@ describe('checkForChanges', () => {
|
||||
dot: true,
|
||||
silent: true,
|
||||
});
|
||||
expect(readFileStub).to.have.been.calledWith(path.join('my-service/.serverless/func1.zip'));
|
||||
expect(readFileStub).to.have.been.calledWith(path.join('my-service/.serverless/func2.zip'));
|
||||
expect(readFileStub).to.have.been.calledWith(
|
||||
path.resolve(awsDeploy.serverless.config.servicePath, '.serverless/func1.zip')
|
||||
);
|
||||
expect(readFileStub).to.have.been.calledWith(
|
||||
path.resolve(awsDeploy.serverless.config.servicePath, '.serverless/func2.zip')
|
||||
);
|
||||
expect(awsDeploy.serverless.service.provider.shouldNotDeploy).to.equal(undefined);
|
||||
});
|
||||
});
|
||||
@ -474,7 +478,7 @@ describe('checkForChanges', () => {
|
||||
silent: true,
|
||||
});
|
||||
expect(readFileStub).to.have.been.calledWith(
|
||||
path.join('my-service/.serverless/my-service.zip')
|
||||
path.resolve(awsDeploy.serverless.config.servicePath, '.serverless/my-service.zip')
|
||||
);
|
||||
expect(awsDeploy.serverless.service.provider.shouldNotDeploy).to.equal(undefined);
|
||||
});
|
||||
@ -512,7 +516,7 @@ describe('checkForChanges', () => {
|
||||
silent: true,
|
||||
});
|
||||
expect(readFileStub).to.have.been.calledWith(
|
||||
path.join('my-service/.serverless/my-service.zip')
|
||||
path.resolve(awsDeploy.serverless.config.servicePath, '.serverless/my-service.zip')
|
||||
);
|
||||
expect(awsDeploy.serverless.service.provider.shouldNotDeploy).to.equal(true);
|
||||
});
|
||||
@ -554,7 +558,7 @@ describe('checkForChanges', () => {
|
||||
silent: true,
|
||||
});
|
||||
expect(readFileStub).to.have.been.calledWith(
|
||||
path.join('my-service/.serverless/my-service.zip')
|
||||
path.resolve(awsDeploy.serverless.config.servicePath, '.serverless/my-service.zip')
|
||||
);
|
||||
expect(awsDeploy.serverless.service.provider.shouldNotDeploy).to.equal(true);
|
||||
}
|
||||
@ -599,8 +603,12 @@ describe('checkForChanges', () => {
|
||||
dot: true,
|
||||
silent: true,
|
||||
});
|
||||
expect(readFileStub).to.have.been.calledWith(path.join('my-service/.serverless/func1.zip'));
|
||||
expect(readFileStub).to.have.been.calledWith(path.join('my-service/.serverless/func2.zip'));
|
||||
expect(readFileStub).to.have.been.calledWith(
|
||||
path.resolve(awsDeploy.serverless.config.servicePath, '.serverless/func1.zip')
|
||||
);
|
||||
expect(readFileStub).to.have.been.calledWith(
|
||||
path.resolve(awsDeploy.serverless.config.servicePath, '.serverless/func2.zip')
|
||||
);
|
||||
expect(awsDeploy.serverless.service.provider.shouldNotDeploy).to.equal(true);
|
||||
});
|
||||
});
|
||||
@ -641,7 +649,7 @@ describe('checkForChanges', () => {
|
||||
silent: true,
|
||||
});
|
||||
expect(readFileStub).to.have.been.calledWith(
|
||||
path.join('my-service/.serverless/my-service/.serverless/foo/bar/my-own.zip')
|
||||
path.resolve(awsDeploy.serverless.config.servicePath, '.serverless/foo/bar/my-own.zip')
|
||||
);
|
||||
expect(awsDeploy.serverless.service.provider.shouldNotDeploy).to.equal(undefined);
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user