mirror of
https://github.com/livebook-dev/livebook.git
synced 2024-11-16 04:46:46 +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
22 lines
702 B
Elixir
22 lines
702 B
Elixir
defmodule LivebookWeb.MemoryProviderTest do
|
|
use ExUnit.Case, async: true
|
|
|
|
defmodule MyProvider do
|
|
use LivebookWeb.MemoryProvider,
|
|
from: Path.expand("../../support/static", __DIR__),
|
|
gzip: true
|
|
end
|
|
|
|
test "includes uncompressed files that are not gzippable" do
|
|
assert %{content: ""} = MyProvider.get_file(["icon.ico"], nil)
|
|
end
|
|
|
|
test "includes compressed files which are gzippable" do
|
|
assert %{content: content} = MyProvider.get_file(["js", "app.js"], :gzip)
|
|
assert :zlib.gunzip(content) == ~s{console.log("Hello");\n}
|
|
end
|
|
|
|
test "does not include uncompressed files that are gzippable" do
|
|
assert nil == MyProvider.get_file(["js", "app.js"], nil)
|
|
end
|
|
end
|