Sha256: fe490f9482bd26657844d573ba0c3dfd9addafc3ec1ad6ed047e31dfa8b3d8f5

Contents?: true

Size: 783 Bytes

Versions: 10

Compression:

Stored size: 783 Bytes

Contents

require 'test_helper'

class UglifyMinifierTest < ActiveSupport::TestCase

  def setup
    super
    @env.unregister_preprocessor('application/javascript', Condenser::BabelProcessor)
    @env.unregister_exporter('application/javascript', Condenser::RollupProcessor)
  end

  test 'simple example' do
    file 'test.js', <<~JS
      function fa() {
        var u;
        var al = 1;
        var bl = 2;
        console.log(al);

        return 2 + 3;
      }
    JS
    
    @env.logger.expects(:warn).with('WARN: Dropping unused variable a [test.js:2,6]')
    @env.logger.expects(:warn).with('WARN: Dropping unused variable c [test.js:4,6]')
    
    assert_exported_file 'test.js', 'application/javascript', <<~CSS
      function fa(){return console.log(1),5}
    CSS
  end
  
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
condenser-1.2 test/minifiers/uglify_minifier_test.rb
condenser-1.0 test/minifiers/uglify_minifier_test.rb
condenser-1.0.rc1 test/minifiers/uglify_minifier_test.rb
condenser-0.3 test/minifiers/uglify_minifier_test.rb
condenser-0.2 test/minifiers/uglify_minifier_test.rb
condenser-0.1 test/minifiers/uglify_minifier_test.rb
condenser-0.0.12 test/minifiers/uglify_minifier_test.rb
condenser-0.0.11 test/minifiers/uglify_minifier_test.rb
condenser-0.0.10 test/minifiers/uglify_minifier_test.rb
condenser-0.0.9 test/minifiers/uglify_minifier_test.rb