Skip to content

Commit

Permalink
Merge pull request #83 from keathley/allow-users-to-turn-off-js-errors
Browse files Browse the repository at this point in the history
Fix issue with disabling js-errors
  • Loading branch information
keathley authored Aug 16, 2016
2 parents 28045a3 + 07105f7 commit 2df4e71
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/wallaby.ex
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ defmodule Wallaby do
end

def js_errors? do
Application.get_env(:wallaby, :js_errors) || true
Application.get_env(:wallaby, :js_errors, true)
end

def phantomjs_path do
Expand Down
14 changes: 14 additions & 0 deletions test/wallaby/driver/configuration_test.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
defmodule Wallaby.Driver.ConfigurationTest do
use Wallaby.SessionCase, async: false

test "js errors can be disabled", %{session: session, server: server} do
Application.put_env(:wallaby, :js_errors, false)

session
|> visit(server.base_url <> "/errors.html")
|> click_on("Throw an Error")
|> assert

Application.put_env(:wallaby, :js_errors, nil)
end
end
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule Wallaby.DriverTest do
defmodule Wallaby.Driver.JSErrorsTest do
use Wallaby.SessionCase, async: true

import ExUnit.CaptureIO
Expand Down

0 comments on commit 2df4e71

Please sign in to comment.