New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suppress confusing warning "A valid undefined..." #5723

Merged
merged 1 commit into from Jan 21, 2019
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+19 −2
Diff settings

Always

Just for now

Copy path View file
@@ -815,8 +815,10 @@ class Variables {
} else if (variableString.match(this.ssmRefSyntax)) { } else if (variableString.match(this.ssmRefSyntax)) {
varType = 'SSM parameter'; varType = 'SSM parameter';
} }
logWarning(`A valid ${varType} to satisfy the declaration '${ if (!_.isUndefined(varType)) {
variableString}' could not be found.`); logWarning(`A valid ${varType} to satisfy the declaration '${
variableString}' could not be found.`);
}
} }
return valueToPopulate; return valueToPopulate;
} }
Copy path View file
@@ -1854,6 +1854,21 @@ module.exports = {
varProxy.warnIfNotFound('self:service', 'a-valid-value'); varProxy.warnIfNotFound('self:service', 'a-valid-value');
expect(logWarningSpy).to.not.have.been.calledOnce; expect(logWarningSpy).to.not.have.been.calledOnce;
}); });
describe('when variable string does not match any of syntax', () => {
// These situation happen when deep variable population fails
it('should do nothing if variable has null value.', () => {
varProxy.warnIfNotFound('', null);
expect(logWarningSpy).to.not.have.been.calledOnce;
});
it('should do nothing if variable has undefined value.', () => {
varProxy.warnIfNotFound('', undefined);
expect(logWarningSpy).to.not.have.been.calledOnce;
});
it('should do nothing if variable has empty object value.', () => {
varProxy.warnIfNotFound('', {});
expect(logWarningSpy).to.not.have.been.calledOnce;
});
});
it('should log if variable has null value.', () => { it('should log if variable has null value.', () => {
varProxy.warnIfNotFound('self:service', null); varProxy.warnIfNotFound('self:service', null);
expect(logWarningSpy).to.have.been.calledOnce; expect(logWarningSpy).to.have.been.calledOnce;
ProTip! Use n and p to navigate between commits in a pull request.