• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

gulpjs / vinyl-fs / 5233172227

pending completion
5233172227

push

github

web-flow
chore: Add integration test for re-assigning a stream to contents (#339)

332 of 370 branches covered (89.73%)

588 of 616 relevant lines covered (95.45%)

125893.96 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

91.67
/lib/dest/sourcemap.js
1
'use strict';
2

3
var Transform = require('streamx').Transform;
12✔
4
var sourcemap = require('vinyl-sourcemap');
12✔
5

6
function sourcemapStream(optResolver) {
7
  function saveSourcemap(file, callback) {
8
    var self = this;
221,436✔
9

10
    var srcMap = optResolver.resolve('sourcemaps', file);
221,436✔
11

12
    if (!srcMap) {
221,436✔
13
      return callback(null, file);
221,292✔
14
    }
15

16
    var srcMapLocation = typeof srcMap === 'string' ? srcMap : undefined;
144✔
17

18
    sourcemap.write(file, srcMapLocation, onWrite);
144✔
19

20
    function onWrite(sourcemapErr, updatedFile, sourcemapFile) {
21
      if (sourcemapErr) {
144!
22
        return callback(sourcemapErr);
×
23
      }
24

25
      self.push(updatedFile);
144✔
26
      if (sourcemapFile) {
144✔
27
        self.push(sourcemapFile);
72✔
28
      }
29

30
      callback();
144✔
31
    }
32
  }
33

34
  return new Transform({
2,964✔
35
    transform: saveSourcemap,
36
  });
37
}
38

39
module.exports = sourcemapStream;
12✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc