mirror of
https://github.com/livebook-dev/livebook.git
synced 2024-12-29 11:11:19 +08:00
8b37e32e3a
* Set up Escript packaging * Use MD5 digest sa ETAG * Make sure changes to the static files recompile the relevant module * Manually start the application in Escript * Set up basic CLI * Run formatter * Start Elixir app before anything else * Improve version output * Build Escript to project root directory * Improve assets handling * Move plug related modules under plugs directory * Include bundled assets in the repository * Use the same plug with different static providers in prod and dev * Refactor providers * Rename StaticProvidedPlug to StaticPlug
21 lines
580 B
Elixir
21 lines
580 B
Elixir
defmodule LivebookWeb.FileSystemProviderTest do
|
|
use ExUnit.Case, async: true
|
|
|
|
defmodule MyProvider do
|
|
use LivebookWeb.FileSystemProvider,
|
|
from: Path.expand("../../support/static", __DIR__)
|
|
end
|
|
|
|
test "includes regular files" do
|
|
assert %{content: content} = MyProvider.get_file(["js", "app.js"], nil)
|
|
assert content == ~s{console.log("Hello");\n}
|
|
end
|
|
|
|
test "ignores directories" do
|
|
assert nil == MyProvider.get_file(["js"], nil)
|
|
end
|
|
|
|
test "ignores non-existent files" do
|
|
assert nil == MyProvider.get_file(["nonexistent.js"], nil)
|
|
end
|
|
end
|