Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
erlang 27.3.4.3
elixir 1.18.4-otp-27
15 changes: 10 additions & 5 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ defmodule WebPushElixir.MixProject do
app: :web_push_elixir,
version: "0.4.0",
elixir: "~> 1.15",
elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() == :prod,
deps: deps(),
description: "Simple web push for Elixir",
Expand All @@ -25,16 +26,20 @@ defmodule WebPushElixir.MixProject do
]
end

# Specifies which paths to compile per environment.
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]

# Run "mix help deps" to learn about dependencies.
defp deps do
[
{:ex_doc, "~> 0.27", only: :dev, runtime: false},
{:excoveralls, "~> 0.10", only: :test},
{:jose, "~> 1.11"},
{:jason, "~> 1.4"},
{:plug, "~> 1.14"},
{:plug_cowboy, "~> 2.0"},
{:httpoison, "~> 2.0"}
{:httpoison, "~> 2.0"},
{:ex_doc, "~> 0.27", only: :dev, runtime: false},
{:excoveralls, "~> 0.10", only: :test},
{:plug, "~> 1.14", only: :test},
{:plug_cowboy, "~> 2.0", only: :test}
]
end
end
File renamed without changes.
5 changes: 4 additions & 1 deletion test/test_helper.exs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
ExUnit.start()

DynamicSupervisor.start_child(WebPushElixir.DynamicSupervisor,{Plug.Cowboy, scheme: :http, plug: WebPushElixir.MockServer, options: [port: 4040]})
DynamicSupervisor.start_child(
WebPushElixir.DynamicSupervisor,
{Plug.Cowboy, scheme: :http, plug: WebPushElixir.MockServer, options: [port: 4040]}
)
4 changes: 3 additions & 1 deletion test/web_push_elixir_test.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
defmodule WebPushElixirTest do
use ExUnit.Case

@subscription '{"endpoint":"http://localhost:4040/some-push-service","keys":{"p256dh":"BNcRdreALRFXTkOOUHK1EtK2wtaz5Ry4YfYCA_0QTpQtUbVlUls0VJXg7A8u-Ts1XbjhazAkj7I99e8QcYP7DkM=","auth":"tBHItJI5svbpez7KI4CCXg=="}}'
@subscription """
{"endpoint":"http://localhost:4040/some-push-service","keys":{"p256dh":"BNcRdreALRFXTkOOUHK1EtK2wtaz5Ry4YfYCA_0QTpQtUbVlUls0VJXg7A8u-Ts1XbjhazAkj7I99e8QcYP7DkM=","auth":"tBHItJI5svbpez7KI4CCXg=="}}
"""

test "it should send notification" do
%{
Expand Down