Skip to content

Commit 016c774

Browse files
committed
Add manifest test
1 parent cf0b415 commit 016c774

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

lib/elixir_script/manifest.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ defmodule ElixirScript.Manifest do
99
@spec write_manifest(binary, map) :: :ok
1010
def write_manifest(manifest_path, modules) do
1111
data = Enum.reduce(modules, %{}, fn {module, info}, current_data ->
12-
Map.put(current_data, module, Map.drop(info, :js_code))
12+
Map.put(current_data, module, Map.drop(info, [:js_code]))
1313
end)
1414

1515
data = :erlang.term_to_binary(data, [:compressed])

test/manifest_test.exs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
defmodule ElixirScript.Manifest.Test do
2+
use ExUnit.Case
3+
alias ElixirScript.Manifest
4+
5+
test "write manifest" do
6+
result = ElixirScript.Compiler.compile(Atom)
7+
path = Path.join([System.tmp_dir(), "write_manifest_test", ".compile.elixir_script"])
8+
Manifest.write_manifest(path, result)
9+
assert File.exists?(path)
10+
end
11+
12+
end

0 commit comments

Comments
 (0)