1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
# frozen_string_literal: true
require 'minitest/autorun'
require 'sprockets/cache'
require 'sprockets/closure_compressor'
class TestClosureCompressor < Minitest::Test
def test_compress_javascript
input = {
data: "function foo() {\n return true;\n}",
cache: Sprockets::Cache.new
}
output = "function foo(){return!0};\n"
begin
assert_equal output, Sprockets::ClosureCompressor.call(input)
rescue Closure::Error
skip "No Java runtime present"
end
end
def test_cache_key
assert Sprockets::ClosureCompressor.cache_key
end
end
|