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

Commit 187adc9

Browse files
Move the sourcemap sources test function adjacent to its tests
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.
1 parent 5999cbd commit 187adc9

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

test/test.js

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -150,28 +150,6 @@ describe('options', function () {
150150
this.timeout(20000);
151151

152152
describe('sourcemap', function () {
153-
var includesCorrectSources = function (source, expected) {
154-
var files = [];
155-
var options = assign({}, defaultOptions, {sourcemap: true});
156-
157-
before(function (done) {
158-
sass(source, options)
159-
.on('data', function (data) {
160-
files.push(data);
161-
})
162-
.on('end', function () {
163-
files.sort(sortByRelative);
164-
done();
165-
});
166-
});
167-
168-
it('includes the correct sources', function () {
169-
files.forEach(function (file, i) {
170-
assert.deepEqual(file.sourceMap.sources, expected[i]);
171-
});
172-
});
173-
};
174-
175153
describe('replaces Sass sourcemaps with vinyl sourceMaps', function () {
176154
var files = [];
177155
var options = assign({}, defaultOptions, {sourcemap: true});
@@ -201,6 +179,28 @@ describe('options', function () {
201179
});
202180
});
203181

182+
var includesCorrectSources = function (source, expected) {
183+
var files = [];
184+
var options = assign({}, defaultOptions, {sourcemap: true});
185+
186+
before(function (done) {
187+
sass(source, options)
188+
.on('data', function (data) {
189+
files.push(data);
190+
})
191+
.on('end', function () {
192+
files.sort(sortByRelative);
193+
done();
194+
});
195+
});
196+
197+
it('includes the correct sources', function () {
198+
files.forEach(function (file, i) {
199+
assert.deepEqual(file.sourceMap.sources, expected[i]);
200+
});
201+
});
202+
};
203+
204204
describe('compiling files from a single file source', function () {
205205
var source = ['source/file.scss'];
206206
var expected = [

0 commit comments

Comments
 (0)