-
Notifications
You must be signed in to change notification settings - Fork 68
Expand file tree
/
Copy pathcompiler_test.exs
More file actions
33 lines (26 loc) · 871 Bytes
/
compiler_test.exs
File metadata and controls
33 lines (26 loc) · 871 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
defmodule ElixirScript.Compiler.Test do
use ExUnit.Case
test "Can compile one entry module" do
result = ElixirScript.Compiler.compile(Version)
assert is_binary(result)
end
test "Can compile multiple entry modules" do
result = ElixirScript.Compiler.compile([Atom, String, Agent])
assert is_binary(result)
end
test "Output" do
result = ElixirScript.Compiler.compile(Atom, [])
assert result =~ "export default Elixir"
end
test "Output file with default name" do
path = System.tmp_dir()
ElixirScript.Compiler.compile(Atom, [output: path])
assert File.exists?(Path.join([path, "elixirscript.build.js"]))
end
test "Output file with custom name" do
path = System.tmp_dir()
path = Path.join([path, "myfile.js"])
ElixirScript.Compiler.compile(Atom, [output: path])
assert File.exists?(path)
end
end