Skip to content

Commit

Permalink
Add mixed test
Browse files Browse the repository at this point in the history
  • Loading branch information
jgranstrom committed Jan 24, 2017
1 parent a70de3c commit 73793b6
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const { render, renderSync } = require('../');

const basicImplicitFile = path.join(__dirname, 'sass', 'basic-implicit.scss');
const basicExplicitFile = path.join(__dirname, 'sass', 'basic-explicit.scss');
const basicMixedFile = path.join(__dirname, 'sass', 'basic-mixed.scss');

function verifyBasic(rendered, sourceFile, mapIncluded) {
expect(rendered.vars).to.exist;
Expand Down Expand Up @@ -114,4 +115,22 @@ describe('basic-explicit', () => {
});
});
});
});

describe('basic-mixed', () => {
describe('sync', () => {
it('should extract all variables', () => {
const rendered = renderSync({ file: basicMixedFile })
verifyBasic(rendered, basicMixedFile, true);
});
});

describe('async', () => {
it('should extract all variables', () => {
return render({ file: basicMixedFile })
.then(rendered => {
verifyBasic(rendered, basicMixedFile, true);
});
});
});
});
12 changes: 12 additions & 0 deletions test/sass/basic-mixed.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
$list: 1px solid black;
$string: 'string';
$map: (
number: 2em,
string: 'mapstring'
);

div {
$number1: 100px !global;
$number2: $number1 * 2 !global;
$color: red !global;
}

0 comments on commit 73793b6

Please sign in to comment.