Skip to content

Commit

Permalink
getting line coverage back to 100% and identifying the publish tests …
Browse files Browse the repository at this point in the history
…with 'publsh:'
  • Loading branch information
nmccready committed Oct 14, 2016
1 parent 14fd483 commit 8abf069
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
18 changes: 15 additions & 3 deletions test/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,20 @@ function makeFileCSS() {
}

test('init: should pass through when file is null', function(t) {
// Begin inner conflict with self here..
// nmccready:
//
//
// bliss: Turning debug on here clutters the test output;
// but, having debug off in portions results in not having 100% test coverage.
//
// touche: If we demand 100% coverage, then we need clutter logging :_(
//
// partial-bliss: The alternative is to have ignore cover statements on some of the logging.
// touche: However, those logging statements could potentially fail
debug.save('gulp-sourcemaps:init');
debug.enable(debug.load());
// end inner conflict
var file = new File();
var pipeline = sourcemaps.init();
pipeline.on('data', function(data) {
Expand Down Expand Up @@ -373,8 +387,6 @@ test('init: handle null contents', function(t) {

//should always be last as disabling a debug namespace does not work
test('init: should output an error message if debug option is set and sourceContent is missing', function(t) {
debug.save('gulp-sourcemaps:init');
debug.enable(debug.load());

var file = makeFile();
file.contents = new Buffer(sourceContent + '\n//# sourceMappingURL=helloworld4.js.map');
Expand All @@ -388,7 +400,7 @@ test('init: should output an error message if debug option is set and sourceCont

pipeline.on('data', function() {
unhook();
debug.save(null);
// debug.save(null);
t.ok(history.length == 4, 'history len');
t.ok(history[2].match(/No source content for \"missingfile\". Loading from file./), 'should log missing source content');
t.ok(history[3].match(/source file not found: /), 'should warn about missing file');
Expand Down
2 changes: 1 addition & 1 deletion test/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function makeTestPackage(cb) {
}

// with regards to averting npm publishing disasters https://github.com/floridoo/gulp-sourcemaps/issues/246
test('can load a published version', function(t) {
test('publish: can load a published version', function(t) {
// return t.fail("mock fail");
cleanUp(function() {
makeTestPackage(function() {
Expand Down

0 comments on commit 8abf069

Please sign in to comment.