Sha256: 52b92c13409254cff173f75dea628dc9832e3eb9dc140307e6b22168fdf7f2f5

Contents?: true

Size: 979 Bytes

Versions: 11

Compression:

Stored size: 979 Bytes

Contents

require "test_helper"

class WebpackerTest < Webpacker::Test
  def test_config_params
    assert_equal Rails.env, Webpacker.config.env
    assert_equal Webpacker.instance.root_path, Webpacker.config.root_path
    assert_equal Webpacker.instance.config_path, Webpacker.config.config_path

    with_rails_env("test") do
      assert_equal "test", Webpacker.config.env
    end
  end

  def test_inline_css_no_dev_server
    assert !Webpacker.inlining_css?
  end

  def test_inline_css_with_hmr
    dev_server = Webpacker::DevServer.new({})
    def dev_server.host; "localhost"; end
    def dev_server.port; "3035"; end
    def dev_server.pretty?; false; end
    def dev_server.https?; true; end
    def dev_server.hmr?; true; end
    def dev_server.running?; true; end
    Webpacker.instance.stub(:dev_server, dev_server) do
      assert Webpacker.inlining_css?
    end
  end

  def test_app_autoload_paths_cleanup
    assert_empty $test_app_autoload_paths_in_initializer
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
shakapacker-6.1.1 test/webpacker_test.rb
shakapacker-6.1.0 test/webpacker_test.rb
shakapacker-6.1.0.beta.0 test/webpacker_test.rb
shakapacker-6.0.2 test/webpacker_test.rb
shakapacker-6.0.1 test/webpacker_test.rb
shakapacker-6.0.0 test/webpacker_test.rb
shakapacker-6.0.0.rc.14 test/webpacker_test.rb
shakapacker-6.0.0.rc.13 test/webpacker_test.rb
shakapacker-6.0.0.rc.12 test/webpacker_test.rb
shakapacker-6.0.0.rc.6 test/webpacker_test.rb
webpacker-6.0.0.rc.6 test/webpacker_test.rb