Packages
Write pipeable, fast, and easy-to-read feature tests for your Phoenix apps in a unified way -- regardless of whether you're testing LiveView pages or static pages.
Current section
Files
Jump to
Current section
Files
lib/phoenix_test/file_upload.ex
defmodule PhoenixTest.FileUpload do
@moduledoc false
def mime_type(path) do
if Code.ensure_loaded?(MIME) do
"." <> ext = Path.extname(path)
MIME.type(ext)
else
"application/octet-stream"
end
end
end