Skip to content
This repository has been archived by the owner on Jan 23, 2021. It is now read-only.

Commit

Permalink
Move the sourcemap sources test function adjacent to its tests
Browse files Browse the repository at this point in the history
Kind of picking at things now, but I want them to be understandable to future me
and anyone else that wants to contribute. This plugin seems really stable and
feature complete; I don't think I'm going to touch it for a while.
  • Loading branch information
robwierzbowski committed Sep 11, 2015
1 parent 5999cbd commit 187adc9
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,28 +150,6 @@ describe('options', function () {
this.timeout(20000);

describe('sourcemap', function () {
var includesCorrectSources = function (source, expected) {
var files = [];
var options = assign({}, defaultOptions, {sourcemap: true});

before(function (done) {
sass(source, options)
.on('data', function (data) {
files.push(data);
})
.on('end', function () {
files.sort(sortByRelative);
done();
});
});

it('includes the correct sources', function () {
files.forEach(function (file, i) {
assert.deepEqual(file.sourceMap.sources, expected[i]);
});
});
};

describe('replaces Sass sourcemaps with vinyl sourceMaps', function () {
var files = [];
var options = assign({}, defaultOptions, {sourcemap: true});
Expand Down Expand Up @@ -201,6 +179,28 @@ describe('options', function () {
});
});

var includesCorrectSources = function (source, expected) {
var files = [];
var options = assign({}, defaultOptions, {sourcemap: true});

before(function (done) {
sass(source, options)
.on('data', function (data) {
files.push(data);
})
.on('end', function () {
files.sort(sortByRelative);
done();
});
});

it('includes the correct sources', function () {
files.forEach(function (file, i) {
assert.deepEqual(file.sourceMap.sources, expected[i]);
});
});
};

describe('compiling files from a single file source', function () {
var source = ['source/file.scss'];
var expected = [
Expand Down

0 comments on commit 187adc9

Please sign in to comment.