-
Notifications
You must be signed in to change notification settings - Fork 226
Expand file tree
/
Copy pathmix_clean_test.exs
More file actions
47 lines (37 loc) · 1.33 KB
/
mix_clean_test.exs
File metadata and controls
47 lines (37 loc) · 1.33 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
defmodule ElixirLS.LanguageServer.Providers.ExecuteCommand.MixCleanTest do
alias ElixirLS.LanguageServer.{Server, Protocol, SourceFile}
use ElixirLS.Utils.MixTest.Case, async: false
use Protocol
setup do
server = ElixirLS.LanguageServer.Test.ServerTestHelpers.start_server()
{:ok, %{server: server}}
end
@tag fixture: true
test "mix clean", %{server: server} do
in_fixture(Path.join(__DIR__, "../.."), "clean", fn ->
root_uri = SourceFile.path_to_uri(File.cwd!())
Server.receive_packet(server, initialize_req(1, root_uri, %{}))
Server.receive_packet(
server,
did_change_configuration(%{
"elixirLS" => %{"dialyzerEnabled" => false}
})
)
assert_receive %{
"method" => "window/logMessage",
"params" => %{"message" => "Compile took" <> _}
},
20000
path = ".elixir_ls/build/test/lib/els_clean_test/ebin/Elixir.A.beam"
assert File.exists?(path)
server_instance_id = :sys.get_state(server).server_instance_id
Server.receive_packet(
server,
execute_command_req(4, "mixClean:#{server_instance_id}", [false])
)
res = assert_receive(%{"id" => 4}, 5000)
assert res["result"] == %{}
refute File.exists?(path)
end)
end
end