You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.3 KiB

  1. 'use strict';
  2. var grunt = require('grunt');
  3. var tmp = 'tmp/',
  4. fixtures = 'test/fixtures/expected/';
  5. exports.contrib_uglify = {
  6. preuglified_files: function(test) {
  7. var files = [
  8. 'comments.js',
  9. 'compress.js',
  10. 'compress_mangle.js',
  11. 'compress_mangle_beautify.js',
  12. 'compress_mangle_except.js',
  13. 'compress_mangle_sourcemap',
  14. 'sourcemapurl.js',
  15. 'multifile.js',
  16. 'wrap.js',
  17. 'exportAll.js',
  18. 'sourcemap_prefix'
  19. ];
  20. test.expect(files.length);
  21. files.forEach(function(file){
  22. var actual = grunt.file.read(tmp + file);
  23. var expected = grunt.file.read(fixtures + file);
  24. test.equal(actual, expected, 'task output should equal ' + file);
  25. });
  26. test.done();
  27. },
  28. relative_test : function(test) {
  29. var files = [
  30. 'sourcemapin',
  31. 'sourcemapin.js',
  32. 'multiple_sourcemaps1.js',
  33. 'multiple_sourcemaps1.map',
  34. 'multiple_sourcemaps2.js',
  35. 'multiple_sourcemaps2.map',
  36. ];
  37. test.expect(files.length);
  38. files.forEach(function(file){
  39. var actual = grunt.file.read(tmp + file).replace(tmp,'REPLACED');
  40. var expected = grunt.file.read(fixtures + file).replace(fixtures,'REPLACED');
  41. test.equal(actual, expected, 'task output should equal ' + file);
  42. });
  43. test.done();
  44. }
  45. };