Skip to content

Commit 9e33e1b

Browse files
author
Eric Czajkowski
committed
feat: support relative serverless config
1 parent effcfd1 commit 9e33e1b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

lib/yamlParser.test.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
const expect = require('chai').expect;
44
const sinon = require('sinon');
5+
const path = require('path');
56
const BbPromise = require('bluebird');
67
const Serverless = require('serverless/lib/Serverless');
78
const AwsProvider = require('serverless/lib/plugins/aws/provider/awsProvider');
@@ -154,6 +155,17 @@ describe('#yamlParse', () => {
154155
expect(yamlParserStub.calledWith(`${servicePath}/${fileName}`)).to.be.equal(true);
155156
});
156157
});
158+
159+
it('should read relative serviceFileName path if passed as --config option', () => {
160+
const servicePath = serverlessStepFunctions.serverless.config.servicePath;
161+
const relativeFilename = './some_folder/other_config.yml';
162+
serverlessStepFunctions.options.config = relativeFilename;
163+
const serviceFilePath = path.normalize(`${servicePath}/${relativeFilename}`);
164+
serverlessStepFunctions.yamlParse()
165+
.then(() => {
166+
expect(yamlParserStub.calledWith(serviceFilePath)).to.be.equal(true);
167+
});
168+
});
157169
});
158170

159171
describe('#getAllStateMachines()', () => {

0 commit comments

Comments
 (0)