Skip to content

Commit

Permalink
feat(normalize-word): expose normalize word private method
Browse files Browse the repository at this point in the history
  • Loading branch information
eoneill committed Aug 3, 2016
1 parent b5e8483 commit dd10db9
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
6 changes: 6 additions & 0 deletions eyeglass-exports.js
Expand Up @@ -174,6 +174,12 @@ module.exports = function(eyeglass, sass) {
else {
done(toSass(result));
}
},

"normalize-word($word)": function($word, done) {
var word = toJS($word);
var normalizedWord = util.normalizeWord(word);
done(toSass(normalizedWord));
}
})
};
Expand Down
3 changes: 3 additions & 0 deletions test/fixtures/util.css
Expand Up @@ -33,3 +33,6 @@
/* [PASS] -restyle--normalize-property-js(test-foo): test-foo */
/* [PASS] -restyle--normalize-property(test): test */
/* [PASS] -restyle--normalize-property-js(test): test */ }

.normalize-word {
/* [PASS] -restyle--normalize-word-js(yellow): yellow */ }
11 changes: 11 additions & 0 deletions test/fixtures/util.scss
Expand Up @@ -51,3 +51,14 @@
/* [#{if($actual == $expected, PASS, FAIL)}] -restyle--normalize-property-js(#{$test}): #{$actual} */
}
}

.normalize-word {
$tests: (
yellow: 'yellow'
);

@each $test, $expected in $tests {
$actual: -restyle--normalize-word-js($test);
/* [#{if($actual == $expected, PASS, FAIL)}] -restyle--normalize-word-js(#{$test}): #{$actual} */
}
}

0 comments on commit dd10db9

Please sign in to comment.