Skip to content

Commit af33773

Browse files
committed
Handle Bun priting loaded env variables on STDERR
Fix: #130
1 parent 6c1c228 commit af33773

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/test_execjs.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,16 @@ def test_call_with_complex_properties
5656
assert_equal 2, context.call("(function(bar) { return foo + bar })", 1)
5757
end
5858

59+
def test_call_with_env_file
60+
Dir.mktmpdir do |dir|
61+
Dir.chdir(dir) do
62+
# Bun prints on STDOUT when loading .env files
63+
File.write(".env", "FOO=BAR")
64+
assert_equal 2, ExecJS.eval("1 + 1")
65+
end
66+
end
67+
end
68+
5969
def test_call_with_this
6070
# Known bug: https://github.com/cowboyd/therubyrhino/issues/39
6171
skip if ExecJS.runtime.is_a?(ExecJS::RubyRhinoRuntime)

0 commit comments

Comments
 (0)