Skip to content

Commit

Permalink
Add core functionality tests
Browse files Browse the repository at this point in the history
  • Loading branch information
benthemonkey committed Nov 10, 2015
1 parent ee3d21c commit 9829926
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions tests/main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/* eslint-env mocha */

var fs = require('fs');
var assert = require('assert');
var scss2sass = require('../index');

Expand All @@ -9,4 +11,33 @@ describe('Convert', function () {
{ include: 'foo/bar.scss' }
);
});

it('unsupported linter', function () {
assert.deepEqual(
scss2sass.convert({ linters: { 'UnsupportedLinter': { enabled: true } } }, { debug: true }).unsupported,
['UnsupportedLinter']
);
});

it('unsupported linter option', function () {
assert.ok(scss2sass.convert(
{ linters: { 'LeadingZero': { enabled: true, unsupported_option: true } } },
{ debug: true }
).warnings[0].indexOf('unsupported_option'));
});

it('unsupported linter option value', function () {
assert.ok(scss2sass.convert(
{ linters: { 'LeadingZero': { enabled: true, style: 'unsupported_value' } } },
{ debug: true }
).warnings[0].indexOf('unsupported_value'));
});
});

describe('ConvertYaml', function () {
it('doesn\'t fail', function () {
var yaml = fs.readFileSync('tests/scss-lint-yml/default.yml');

assert.ok(scss2sass.convertYaml(yaml));
});
});

0 comments on commit 9829926

Please sign in to comment.