Skip to content

Commit 709c0c1

Browse files
committed
revert order
1 parent 77cc1fe commit 709c0c1

File tree

3 files changed

+33
-32
lines changed

3 files changed

+33
-32
lines changed

Gruntfile.js

+11-11
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,6 @@ module.exports = (grunt) => {
2929
},
3030

3131
postcss: {
32-
mapAnnotationPath: {
33-
options: {
34-
map: {
35-
inline: false,
36-
annotation: 'tmp/maps/'
37-
},
38-
processors: processors
39-
},
40-
src: 'test/fixtures/a.css',
41-
dest: 'tmp/mapAnnotationPath.css'
42-
},
4332
defaults: {
4433
options: {
4534
processors: processors
@@ -72,6 +61,17 @@ module.exports = (grunt) => {
7261
src: 'test/fixtures/a.css',
7362
dest: 'tmp/mapSeparate.css'
7463
},
64+
mapAnnotationPath: {
65+
options: {
66+
map: {
67+
inline: false,
68+
annotation: 'tmp/maps/'
69+
},
70+
processors: processors
71+
},
72+
src: 'test/fixtures/a.css',
73+
dest: 'tmp/mapAnnotationPath.css'
74+
},
7575
diff: {
7676
options: {
7777
diff: true,

tasks/postcss.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ module.exports = (grunt) => {
4545
}
4646

4747
if (typeof options.map.annotation === 'string') {
48+
//annotation = path.relative(path.dirname(to), getSourcemapPath(to));
4849
annotation = path.relative(path.dirname(to), getSourcemapPath(to)).replace(/\\/g, '/');
4950
}
5051

@@ -63,7 +64,8 @@ module.exports = (grunt) => {
6364
prev: getPrevMap(from),
6465
inline: (typeof options.map.inline === 'boolean') ? options.map.inline : true,
6566
annotation: getAnnotation(to),
66-
sourcesContent: (typeof options.map.sourcesContent === 'boolean') ? options.map.sourcesContent : true
67+
sourcesContent: (typeof options.map.sourcesContent === 'boolean') ? options.map.sourcesContent : true,
68+
//absolute: (typeof options.map.absolute === 'boolean') ? options.map.absolute : false
6769
},
6870
from: from,
6971
to: to,

test/test.js

+19-20
Original file line numberDiff line numberDiff line change
@@ -26,32 +26,12 @@ const fileExists = async(file) => {
2626
await access(file);
2727
return true;
2828
} catch (error) {
29-
console.log(error);
3029
return false;
3130
}
3231
};
3332

3433
exports.gruntPostcss = {
3534

36-
mapAnnotationPath: async(test) => {
37-
const actual = {
38-
css: await readFile('tmp/mapAnnotationPath.css', 'utf8'),
39-
map: await readFile('tmp/maps/mapAnnotationPath.css.map', 'utf8'),
40-
};
41-
42-
const expected = {
43-
css: await readFile('test/expected/mapAnnotationPath.css', 'utf8'),
44-
map: await readFile('test/expected/maps/mapAnnotationPath.css.map', 'utf8'),
45-
};
46-
47-
test.strictEqual(actual.css, expected.css);
48-
test.strictEqual(actual.map, expected.map);
49-
50-
const checkExists = await fileExists('tmp/mapAnnotationPath.css.map');
51-
test.ok(!checkExists);
52-
test.done();
53-
},
54-
5535
defaults: async(test) => {
5636
const actual = {
5737
css: await readFile('tmp/defaults.css', 'utf8'),
@@ -116,6 +96,25 @@ exports.gruntPostcss = {
11696
test.done();
11797
},
11898

99+
mapAnnotationPath: async(test) => {
100+
const actual = {
101+
css: await readFile('tmp/mapAnnotationPath.css', 'utf8'),
102+
map: await readFile('tmp/maps/mapAnnotationPath.css.map', 'utf8'),
103+
};
104+
105+
const expected = {
106+
css: await readFile('test/expected/mapAnnotationPath.css', 'utf8'),
107+
map: await readFile('test/expected/maps/mapAnnotationPath.css.map', 'utf8'),
108+
};
109+
110+
test.strictEqual(actual.css, expected.css);
111+
test.strictEqual(actual.map, expected.map);
112+
113+
const checkExists = await fileExists('tmp/mapAnnotationPath.css.map');
114+
test.ok(!checkExists);
115+
test.done();
116+
},
117+
119118
diff: async(test) => {
120119
const actual = {
121120
css: await readFile('tmp/diff.css', 'utf8'),

0 commit comments

Comments
 (0)