Sha256: 049dd6823eb0888124067d3b11b2c52b642fdc95285327d571f569f4af289600

Contents?: true

Size: 875 Bytes

Versions: 21

Compression:

Stored size: 875 Bytes

Contents

require "test_helper"

class ManifestTest < Minitest::Test
  def test_lookup_exception!
    manifest_path = File.expand_path File.join(File.dirname(__FILE__), "test_app/public/packs", "manifest.json").to_s
    asset_file = "calendar.js"

    Webpacker.config.stub :compile?, false do
      error = assert_raises Webpacker::Manifest::MissingEntryError do
        Webpacker.manifest.lookup!(asset_file)
      end

      assert_match "Webpacker can't find #{asset_file} in #{manifest_path}", error.message
    end
  end

  def test_lookup_success!
    assert_equal Webpacker.manifest.lookup!("bootstrap.js"), "/packs/bootstrap-300631c4f0e0f9c865bc.js"
  end

  def test_lookup_nil
    assert_nil Webpacker.manifest.lookup("foo.js")
  end

  def test_lookup_success
    assert_equal Webpacker.manifest.lookup("bootstrap.js"), "/packs/bootstrap-300631c4f0e0f9c865bc.js"
  end
end

Version data entries

21 entries across 21 versions & 2 rubygems

Version Path
webpacker-3.6.0 test/manifest_test.rb
webpacker-jets-3.2.101 test/manifest_test.rb
webpacker-jets-3.2.100 test/manifest_test.rb
webpacker-4.0.0.pre.3 test/manifest_test.rb
webpacker-3.5.5 test/manifest_test.rb
webpacker-3.5.3 test/manifest_test.rb
webpacker-3.5.2 test/manifest_test.rb
webpacker-3.5.1 test/manifest_test.rb
webpacker-3.5.0 test/manifest_test.rb
webpacker-3.4.3 test/manifest_test.rb
webpacker-4.0.0.pre.pre.2 test/manifest_test.rb
webpacker-4.0.0.pre.pre.1 test/manifest_test.rb
webpacker-3.4.1 test/manifest_test.rb
webpacker-3.4.0 test/manifest_test.rb
webpacker-3.3.1 test/manifest_test.rb
webpacker-3.3.0 test/manifest_test.rb
webpacker-3.2.2 test/manifest_test.rb
webpacker-3.2.1 test/manifest_test.rb
webpacker-3.2.0 test/manifest_test.rb
webpacker-3.1.1 test/manifest_test.rb