Skip to content

Commit

Permalink
fix(API): Ensure serverless.config.servicePath
Browse files Browse the repository at this point in the history
Accidentally removed with serverless#9307
  • Loading branch information
medikoo authored and wwwehr committed Apr 27, 2021
1 parent 1f037be commit f7a5a63
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Serverless.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class Serverless {

if (configObject.serviceDir != null) {
// Modern intialization way, to be the only supported way with v3
this.serviceDir = path.resolve(
configObject.servicePath = this.serviceDir = path.resolve(
ensureString(configObject.serviceDir, {
name: 'config.serviceDir',
Error: ServerlessError,
Expand Down Expand Up @@ -96,6 +96,7 @@ class Serverless {
// Once new variables engine is in, we can remove that patch
delete configObject.configurationPath;
delete configObject.configuration;
delete configObject.serviceDir;
delete configObject._isInvokedByGlobalInstallation;
delete configObject.commands;
delete configObject.isConfigurationResolved;
Expand Down
4 changes: 4 additions & 0 deletions test/unit/lib/Serverless.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,5 +350,9 @@ describe('test/unit/lib/Serverless.test.js', () => {
it('Ensure that instance is setup', async () => {
expect(serverless.variables).to.have.property('variableSyntax');
});

it('Ensure config.servicePath', async () => {
expect(serverless.config).to.have.property('servicePath');
});
});
});

0 comments on commit f7a5a63

Please sign in to comment.