paint-brush
Why I Unit Test My Sass: Mixins 🧪by@spiderpig86
431 reads
431 reads

Why I Unit Test My Sass: Mixins 🧪

by Stanley Lim4mFebruary 4th, 2022
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

In a previous post, I discussed why Sass unit testing is a thing and why you may want to incorporate it into your project. Unit testing Sass functions isn’t too complicated but what about mixins? Testing-wise, it is quite similar. Let’s create a simple viewport mixin similar to the `screen-above()` mixin defined in [Cirrus]. The mixin below will apply styles if it is larger than the specified breakpoints. An error is thrown if the breakpoint does not exist.

Company Mentioned

Mention Thumbnail
featured image - Why I Unit Test My Sass: Mixins 🧪
Stanley Lim HackerNoon profile picture
Stanley Lim

Stanley Lim

@spiderpig86

👋 Hi, I'm Stanley! I'm a software engineer at Snap and an avid contributor to open source.

Learn More
LEARN MORE ABOUT @SPIDERPIG86'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Stanley Lim HackerNoon profile picture
Stanley Lim@spiderpig86
👋 Hi, I'm Stanley! I'm a software engineer at Snap and an avid contributor to open source.

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite