Skip to content

Commit

Permalink
Handle Bun priting loaded env variables on STDERR
Browse files Browse the repository at this point in the history
Fix: #130
  • Loading branch information
byroot committed Sep 16, 2023
1 parent 6c1c228 commit af33773
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/test_execjs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@ def test_call_with_complex_properties
assert_equal 2, context.call("(function(bar) { return foo + bar })", 1)
end

def test_call_with_env_file
Dir.mktmpdir do |dir|
Dir.chdir(dir) do
# Bun prints on STDOUT when loading .env files
File.write(".env", "FOO=BAR")
assert_equal 2, ExecJS.eval("1 + 1")
end
end
end

def test_call_with_this
# Known bug: https://github.com/cowboyd/therubyrhino/issues/39
skip if ExecJS.runtime.is_a?(ExecJS::RubyRhinoRuntime)
Expand Down

0 comments on commit af33773

Please sign in to comment.