Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lessthanseventy committed Apr 22, 2023
1 parent bfc4d4e commit 2ec622a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
2 changes: 0 additions & 2 deletions lib/mix/tasks/excessibility.ex
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ defmodule Mix.Tasks.Excessibility do
def run(_args) do
Mix.Task.run(@assets_task)

File.mkdir_p("#{@ex_assets_path}/css/")
File.mkdir_p("#{@ex_assets_path}/js/")
File.mkdir_p("#{@snapshots_path}/")

File.ls!(@snapshots_path)
Expand Down
12 changes: 3 additions & 9 deletions test/excessibility_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,15 @@ defmodule ExcessibilityTest do

import ExUnit.CaptureIO

@output_path "test/excessibility"
@snapshots_path "#{@output_path}/html_snapshots"
@ex_assets_path "#{@output_path}/assets"
@snapshots_path "test/excessibility/html_snapshots"

describe "run/1" do
@describetag :flipper
test "when all pa11y checks pass" do
Mix.Project.in_project(:test_pass, "test_pass/", fn _ ->
assert capture_io(fn ->
refute capture_io(fn ->
Mix.Task.run("excessibility")
end) =~
"Error:"
|> IO.inspect()
end)
end

Expand All @@ -25,14 +21,12 @@ defmodule ExcessibilityTest do
Mix.Task.run("excessibility")
end) =~
"Error:"
|> IO.inspect()
end)
end

test "creates necessary directories for assets" do
Mix.Project.in_project(:test_pass, "test_pass/", fn _ ->
assert File.exists?("#{@ex_assets_path}/css")
assert File.exists?("#{@ex_assets_path}/js")
assert File.exists?("#{@snapshots_path}")
end)
end
end
Expand Down
2 changes: 1 addition & 1 deletion test_fail/test/test_helper.exs
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
ExUnit.start(exclude: [:flipper])
ExUnit.start()
Ecto.Adapters.SQL.Sandbox.mode(TestFail.Repo, :manual)

0 comments on commit 2ec622a

Please sign in to comment.