diff --git a/.travis.yml b/.travis.yml index 3dc43d8..b46fcdd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,9 +13,8 @@ cache: - node_modules install: - - npm i -g npm@4.5.X + - npm i -g npm@latest - npm install - - echo `npm --version` after_script: - npm run coveralls @@ -23,13 +22,3 @@ after_script: branches: except: - /^v[0-9]/ -env: - global: - - CXX=g++-4.8 - - NUM_MEMORY_TESTS=10 -addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-4.8 diff --git a/package.json b/package.json index 4461539..b532005 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,6 @@ "vinyl": "1.X" }, "devDependencies": { - "bluebird": "^3.5.0", "bootstrap": "3.3.7", "coveralls": "2.X", "faucet": "0.0.X", @@ -51,7 +50,6 @@ "istanbul": "0.X", "jshint": "2.X", "lodash": "4.17.4", - "memwatch-next": "^0.3.0", "mississippi": "^1.3.0", "object-assign": "^4.1.0", "tape": "4.X", diff --git a/test/init.js b/test/init.js index d4b7238..8b16130 100644 --- a/test/init.js +++ b/test/init.js @@ -75,13 +75,6 @@ function makeFileCSS() { }); } -var startDate = Date.now(); - -test.onFinish(function(){ - var delta = Date.now() - startDate; - console.log("Total Test Time: " + delta); -}); - test('init: should pass through when file is null', function(t) { // end inner conflict var file = new File(); diff --git a/test/integration.js b/test/integration.js index 90a0555..93d34fa 100644 --- a/test/integration.js +++ b/test/integration.js @@ -5,8 +5,6 @@ var test = require('tape'); var sourcemaps = require('..'); var yargs = require('yargs').argv; var debug = require('debug-fabulous')(); -var Promise = require('bluebird'); - if (!yargs.ignoreLogTests){ debug.save('gulp-sourcemaps:*'); debug.enable(debug.load()); @@ -16,8 +14,6 @@ var fs = require('fs'); var sourceContent = fs.readFileSync(join(__dirname, 'assets/helloworld.js')).toString(); var _ = require('lodash'); -var memwatch = require('memwatch-next'); -var heapDiff; function base64JSON(object) { return 'data:application/json;charset=utf8;base64,' + new Buffer(JSON.stringify(object)).toString('base64'); @@ -31,23 +27,6 @@ function moveHtml(dest, t){ debug('running'); -var startDate = Date.now(); - -test.onFinish(function(){ - var delta = Date.now() - startDate; - console.log("Total Test Time: " + delta); - - var hde = heapDiff.end(); - var change = hde.change; - change.details = null; - - console.log(JSON.stringify({ - before: hde.before, - after: hde.after, - change: change - }, null, 2)); -}); - test('combined: creates inline mapping', function(t) { gulp.src(join(__dirname, './assets/helloworld.js')) @@ -72,30 +51,6 @@ test('combined: creates inline mapping', function(t) { }); }); -test('leak', function(t) { - - gulp.src(join(__dirname, './assets/helloworld.js')) - .pipe(sourcemaps.init()) - .pipe(sourcemaps.write()) - // .pipe(gulp.dest('tmp')) - .on('data', function(data) { - t.ok(data.sourceMap, 'should add a source map object'); - t.deepEqual( - data.contents.toString(), - sourceContent + '\n//# sourceMappingURL=' + base64JSON(data.sourceMap) + '\n', - 'file should be sourcemapped' - ); - t.end(); - }) - .on('error', function() { - t.fail('emitted error'); - t.end(); - }) - .on('close', function() { - t.end(); - }); -}); - test('combined: creates preExistingComment , no new previous line', function(t) { gulp.src(join(__dirname, './assets/helloworld.map.js')) .pipe(sourcemaps.init({loadMaps:true})) @@ -310,42 +265,29 @@ test('sources: is valid with concat', function(t) { }); // - thanks @twiggy https://github.com/floridoo/gulp-sourcemaps/issues/270#issuecomment-271723208 -test('leak', function(t) { - var promises = []; - heapDiff = new memwatch.HeapDiff(); - function addPromise(i){ - promises.push(new Promise(function(resolve, reject){ - gulp.src([ - join(__dirname, './assets/test3.js'), - join(__dirname, './assets/test4.js'), - ]) - .pipe(sourcemaps.init()) - .pipe($.concat("index.js")) - .pipe(sourcemaps.write('.', {mapSourcesAbsolute:true})) - .pipe(gulp.dest('tmp/sources_concat' + i)) - .on('data', function(file) { - if (!/.*\.map/.test(file.path)) return; - - var contents = JSON.parse(file.contents.toString()); - _.each(contents.sources, function(s, i){ - t.deepEqual(s, "/test/assets/test" + (i+3) + ".js", "source is correct, test" + (i+3) + ".js"); - }); - }) - .on('error', reject) - .on('finish', resolve); - })); - } +test('sources: mapSourcesAbsolute: is valid with concat', function(t) { - var numOfTests = process.env.NUM_MEMORY_TESTS ? parseInt(process.env.NUM_MEMORY_TESTS) : 100; - - for(var i = 0; i < numOfTests; i++){ - addPromise(i); - } + gulp.src([ + join(__dirname, './assets/test3.js'), + join(__dirname, './assets/test4.js'), + ]) + .pipe(sourcemaps.init()) + .pipe($.concat("index.js")) + .pipe(sourcemaps.write('.', {mapSourcesAbsolute:true})) + .pipe(gulp.dest('tmp/sources_concat')) + .on('data', function(file) { + if (!/.*\.map/.test(file.path)) return; - Promise.all(promises) - .then(function(tests){ - console.log("=======================\n\n"+ tests.length + " done!!"); - t.end(); + var contents = JSON.parse(file.contents.toString()); + _.each(contents.sources, function(s, i){ + t.deepEqual(s, "/test/assets/test" + (i+3) + ".js", "source is correct, test" + (i+3) + ".js"); + }); }) - .catch(t.fail); + .on('error', function() { + t.fail('emitted error'); + t.end(); + }).on('finish', function(){ + moveHtml('sources_concat', t); + }); + }); diff --git a/test/write.js b/test/write.js index 7ea1a14..2bcca53 100644 --- a/test/write.js +++ b/test/write.js @@ -90,13 +90,6 @@ function makeStreamFile() { return file; } -var startDate = Date.now(); - -test.onFinish(function(){ - var delta = Date.now() - startDate; - console.log("Total Test Time: " + delta); -}); - test('write: should pass through when file is null', function(t) { var file = new File(); var pipeline = sourcemaps.write();