Skip to content

Commit 69b2254

Browse files
author
Étienne Lévesque
authored
Fixes tests not compiling after first run (#463)
* Fixes tests not compiling after first run * Move temporary test files to elixir_ls_utils/.tmp * Add newline at end of gitignore
1 parent 68dd9fa commit 69b2254

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,5 @@ erl_crash.dump
2626
/release
2727

2828
# Also ignore temp files created during testing
29-
**/test/tmp
29+
**/test/tmp
30+
.tmp

apps/elixir_ls_utils/test/support/mix_test.case.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ defmodule ElixirLS.Utils.MixTest.Case do
3737
end
3838

3939
def tmp_path do
40-
Path.expand("../tmp", __DIR__)
40+
Path.expand("../../.tmp", __DIR__)
4141
end
4242

4343
def tmp_path(extension) do

apps/elixir_ls_utils/test/wire_protocol_test.exs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ defmodule ElixirLS.Utils.WireProtocolTest do
33
import ExUnit.CaptureIO
44
alias ElixirLS.Utils.WireProtocol
55

6+
@tmp_folder_path ".tmp"
7+
68
test "sends valid json" do
79
packet = %{"some" => "value"}
810

@@ -18,9 +20,9 @@ defmodule ElixirLS.Utils.WireProtocolTest do
1820
end
1921

2022
test "sends valid json with unicode" do
21-
File.mkdir_p("test/tmp")
22-
File.rm_rf!("test/tmp/packet_stream")
23-
{:ok, pid} = File.open("test/tmp/packet_stream", [:write, :binary])
23+
File.mkdir_p(@tmp_folder_path)
24+
File.rm_rf!("#{@tmp_folder_path}/packet_stream")
25+
{:ok, pid} = File.open("#{@tmp_folder_path}/packet_stream", [:write, :binary])
2426

2527
packet = %{"some" => "👨‍👩‍👦 test"}
2628

@@ -33,7 +35,7 @@ defmodule ElixirLS.Utils.WireProtocolTest do
3335
Task.await(task)
3436
File.close(pid)
3537

36-
bytes = File.read!("test/tmp/packet_stream")
38+
bytes = File.read!("#{@tmp_folder_path}/packet_stream")
3739
assert "Content-Length: 34\r\n\r\n" <> body = bytes
3840
assert byte_size(body) == 34
3941
assert JasonVendored.decode!(body) == packet

apps/language_server/test/fixtures/test_code_lens/mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ defmodule TestCodeLens.MixProject do
22
use Mix.Project
33

44
def project do
5-
[app: :references, version: "0.1.0"]
5+
[app: :test_code_lens, version: "0.1.0"]
66
end
77

88
def application, do: []

0 commit comments

Comments
 (0)