integration.js #1

  • //
  • guest/
  • jen_bottom/
  • ember/
  • tutorial/
  • testapp/
  • node_modules/
  • sourcemap-validator/
  • tests/
  • integration.js
  • View
  • Commits
  • Open Download .zip Download (834 B)
var validate = require('..')
  , fs = require('fs')
  , path = require('path')
  , assert = require('assert')
  , uglify = require('uglify-js')
  , each = require('lodash.foreach')
  , libDir = path.join(__dirname, 'fixtures', 'integration')
  , tests = {}
  , fixtures;

fixtures = fs.readdirSync(libDir);

each(fixtures, function (fixture) {
  if(fixture.charAt(0) == '.')
    return;

  tests['Uglified ' + fixture + ' should not throw'] = function () {
    var raw = fs.readFileSync(path.join(libDir, fixture)).toString()
      , result = uglify.minify(raw, {
          outSourceMap: fixture + '.min.map'
        , fromString: true
        });

    assert.doesNotThrow(function () {
      validate(result.code, result.map, {'?': raw});
    }, 'Valid ' + fixture + ' sourcemap should not throw');
  };
});

module.exports = tests;
# Change User Description Committed
#1 23539 jenbottom Adding the basic code for ember test appk, created with 'ember new' command