Skip to content

Commit

Permalink
Make tests async again with process dict
Browse files Browse the repository at this point in the history
  • Loading branch information
angelikatyborska authored and andreasknoepfle committed Mar 22, 2024
1 parent 8d74258 commit 97af8d4
Show file tree
Hide file tree
Showing 14 changed files with 17 additions and 14 deletions.
5 changes: 4 additions & 1 deletion lib/bitstyles_phoenix/bitstyles.ex
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ defmodule BitstylesPhoenix.Bitstyles do
end

def version do
Application.get_env(:bitstyles_phoenix, :bitstyles_version, @default_version)
bitstyles_version_override = Process.get(:bitstyles_phoenix_bistyles_version)

bitstyles_version_override ||
Application.get_env(:bitstyles_phoenix, :bitstyles_version, @default_version)
end

def default_version do
Expand Down
2 changes: 1 addition & 1 deletion lib/bitstyles_phoenix/showcase.ex
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ defmodule BitstylesPhoenix.Showcase do
doctest_expected_results
|> Enum.map_join("\n\n", fn {version, expected_result} ->
"""
iex> Application.put_env(:bitstyles_phoenix, :bitstyles_version, "#{version}")
iex> Process.put(:bitstyles_phoenix_bistyles_version, "#{version}")
#{doctest_iex_code |> String.replace("iex>", "...>")}
#{expected_result}
"""
Expand Down
2 changes: 1 addition & 1 deletion test/bitstyles_phoenix/alpine3/dropdown_test.exs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
defmodule BitstylesPhoenix.Alpine3.DropdownTest do
use BitstylesPhoenix.ComponentCase, async: false
use BitstylesPhoenix.ComponentCase, async: true

doctest BitstylesPhoenix.Alpine3.Dropdown, import: true
end
2 changes: 1 addition & 1 deletion test/bitstyles_phoenix/alpine3/sidebar_test.exs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
defmodule BitstylesPhoenix.Alpine3.SidebarTest do
use BitstylesPhoenix.ComponentCase, async: false
use BitstylesPhoenix.ComponentCase, async: true

doctest BitstylesPhoenix.Alpine3.Sidebar, import: true
end
2 changes: 1 addition & 1 deletion test/bitstyles_phoenix/component/badge_test.exs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
defmodule BitstylesPhoenix.Component.BadgeTest do
use BitstylesPhoenix.ComponentCase, async: false
use BitstylesPhoenix.ComponentCase, async: true

doctest BitstylesPhoenix.Component.Badge
end
2 changes: 1 addition & 1 deletion test/bitstyles_phoenix/component/breadcrumbs_test.exs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
defmodule BitstylesPhoenix.Component.BreadcrumbsTest do
use BitstylesPhoenix.ComponentCase, async: false
use BitstylesPhoenix.ComponentCase, async: true

doctest BitstylesPhoenix.Component.Breadcrumbs
end
2 changes: 1 addition & 1 deletion test/bitstyles_phoenix/component/button_test.exs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
defmodule BitstylesPhoenix.Component.ButtonTest do
use BitstylesPhoenix.ComponentCase, async: false
use BitstylesPhoenix.ComponentCase, async: true

doctest BitstylesPhoenix.Component.Button

Expand Down
2 changes: 1 addition & 1 deletion test/bitstyles_phoenix/component/description_list_test.exs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
defmodule BitstylesPhoenix.Component.DescriptionListTest do
use BitstylesPhoenix.ComponentCase, async: false
use BitstylesPhoenix.ComponentCase, async: true

doctest BitstylesPhoenix.Component.DescriptionList
end
2 changes: 1 addition & 1 deletion test/bitstyles_phoenix/component/dropdown_test.exs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
defmodule BitstylesPhoenix.Component.DropdownTest do
use BitstylesPhoenix.ComponentCase, async: false
use BitstylesPhoenix.ComponentCase, async: true

doctest BitstylesPhoenix.Component.Dropdown
end
2 changes: 1 addition & 1 deletion test/bitstyles_phoenix/component/error_test.exs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
defmodule BitstylesPhoenix.Component.ErrorTest do
use BitstylesPhoenix.ComponentCase, async: false
use BitstylesPhoenix.ComponentCase, async: true
import BitstylesPhoenix.Helper.TestFixtures

doctest BitstylesPhoenix.Component.Error
Expand Down
2 changes: 1 addition & 1 deletion test/bitstyles_phoenix/component/flash_test.exs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
defmodule BitstylesPhoenix.FlashTest do
use BitstylesPhoenix.ComponentCase, async: false
use BitstylesPhoenix.ComponentCase, async: true

doctest BitstylesPhoenix.Component.Flash
end
2 changes: 1 addition & 1 deletion test/bitstyles_phoenix/component/form_test.exs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
defmodule BitstylesPhoenix.Component.FormTest do
use BitstylesPhoenix.ComponentCase, async: false
use BitstylesPhoenix.ComponentCase, async: true
import BitstylesPhoenix.Helper.TestFixtures
import Phoenix.Component
doctest BitstylesPhoenix.Component.Form
Expand Down
2 changes: 1 addition & 1 deletion test/bitstyles_phoenix/component/icon_test.exs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
defmodule BitstylesPhoenix.Component.IconTest do
use BitstylesPhoenix.ComponentCase, async: false
use BitstylesPhoenix.ComponentCase, async: true

doctest BitstylesPhoenix.Component.Icon
end
2 changes: 1 addition & 1 deletion test/bitstyles_phoenix/component/modal_test.exs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
defmodule BitstylesPhoenix.Component.ModalTest do
use BitstylesPhoenix.ComponentCase, async: false
use BitstylesPhoenix.ComponentCase, async: true

doctest BitstylesPhoenix.Component.Modal
end

0 comments on commit 97af8d4

Please sign in to comment.