From a5dba49ff40c5d1aaf5a8a422e0ad41f674dd25d Mon Sep 17 00:00:00 2001 From: Drew Foehn Date: Mon, 19 Mar 2018 17:02:40 -0400 Subject: [PATCH 1/3] fix: 31 - Added logResolveValueResult --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 382018d..2d00b8a 100644 --- a/index.js +++ b/index.js @@ -234,7 +234,7 @@ module.exports = postcss.plugin('postcss-css-variables', function(options) { ruleToWorkOn.nodes.slice(0).forEach(function(node) { if(node.type === 'decl') { var decl = node; - resolveDecl(decl, map, opts.preserve); + resolveDecl(decl, map, opts.preserve, logResolveValueResult); } }); }); From 2e1d49b0df914d426cb24d3f54f3a0fed9c95d2a Mon Sep 17 00:00:00 2001 From: Drew Foehn Date: Mon, 19 Mar 2018 19:34:00 -0400 Subject: [PATCH 2/3] test: #31 - added test to validate warning message --- test/test.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/test.js b/test/test.js index 4accea7..bb12339 100644 --- a/test/test.js +++ b/test/test.js @@ -199,6 +199,9 @@ describe('postcss-css-variables', function() { var colorDecl = fooRule.nodes[0]; expect(colorDecl.value).to.be.a('string'); expect(colorDecl.value).to.be.equal('undefined'); + + expect(result.warnings()[0].type).to.be.equal('warning'); + expect(result.warnings()[0].text).to.be.equal('variable --missing is undefined and used without a fallback'); }); }); }); From 106808ef8120547cc23bfac9c8e915fd4694f89a Mon Sep 17 00:00:00 2001 From: Drew Foehn Date: Mon, 19 Mar 2018 19:37:18 -0400 Subject: [PATCH 3/3] style: #31 - fixed whitespace --- test/test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test.js b/test/test.js index bb12339..a51e9ff 100644 --- a/test/test.js +++ b/test/test.js @@ -201,7 +201,7 @@ describe('postcss-css-variables', function() { expect(colorDecl.value).to.be.equal('undefined'); expect(result.warnings()[0].type).to.be.equal('warning'); - expect(result.warnings()[0].text).to.be.equal('variable --missing is undefined and used without a fallback'); + expect(result.warnings()[0].text).to.be.equal('variable --missing is undefined and used without a fallback'); }); }); });