Sha256: 131de93da0dd371faabf30db8cf07fd02d453d6b6d0c991d26961791c3bac415

Contents?: true

Size: 919 Bytes

Versions: 10

Compression:

Stored size: 919 Bytes

Contents

require "test_helper"

class CompilerTest < Minitest::Test
  def setup
    Webpacker.compiler.send(:compilation_digest_path).tap do |path|
      path.delete if path.exist?
    end
  end

  def test_custom_environment_variables
    assert Webpacker.compiler.send(:webpack_env)["FOO"] == nil
    Webpacker.compiler.env["FOO"] = "BAR"
    assert Webpacker.compiler.send(:webpack_env)["FOO"] == "BAR"
  end

  def test_default_watched_paths
    assert_equal Webpacker.compiler.send(:default_watched_paths), [
      "app/assets/**/*",
      "/etc/yarn/**/*",
      "test/test_app/app/javascript/**/*",
      "yarn.lock",
      "package.json",
      "config/webpack/**/*"
    ]
  end

  def test_freshness
    assert Webpacker.compiler.stale?
    assert !Webpacker.compiler.fresh?
  end

  def test_compilation_digest_path
    assert Webpacker.compiler.send(:compilation_digest_path).to_s.ends_with?(Webpacker.env)
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
webpacker-jets-3.2.101 test/compiler_test.rb
webpacker-jets-3.2.100 test/compiler_test.rb
webpacker-3.4.3 test/compiler_test.rb
webpacker-3.4.1 test/compiler_test.rb
webpacker-3.4.0 test/compiler_test.rb
webpacker-3.3.1 test/compiler_test.rb
webpacker-3.3.0 test/compiler_test.rb
webpacker-3.2.2 test/compiler_test.rb
webpacker-3.2.1 test/compiler_test.rb
webpacker-3.2.0 test/compiler_test.rb