status-go/server
Eng Zer Jun 83ad76637a
test: use `T.TempDir` to create temporary test directory (#2746)
This commit replaces `os.MkdirTemp` with `t.TempDir` in tests. The
directory created by `t.TempDir` is automatically removed when the test
and all its subtests complete.

Prior to this commit, temporary directory created using `os.MkdirTemp`
needs to be removed manually by calling `os.RemoveAll`, which is omitted
in some tests. The error handling boilerplate e.g.
	defer func() {
		if err := os.RemoveAll(dir); err != nil {
			t.Fatal(err)
		}
	}
is also tedious, but `t.TempDir` handles this for us nicely.

Reference: https://pkg.go.dev/testing#T.TempDir

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2023-04-26 21:39:51 +01:00
..
pairing test: use `T.TempDir` to create temporary test directory (#2746) 2023-04-26 21:39:51 +01:00
servertest Added functionality to slow stop UDP beacon multicast/listen 2023-04-17 12:01:38 +01:00
certs.go Reconciled duplicate cert funcs 2023-03-24 17:31:34 +00:00
certs_test.go Reconciled duplicate cert funcs 2023-03-24 17:31:34 +00:00
device.go Added device name set on Messenger.Start() 2022-11-25 11:33:58 +00:00
device_test.go Added device name set on Messenger.Start() 2022-11-25 11:33:58 +00:00
handlers.go Re-organise the code to be more modular (#3172) 2023-03-01 17:23:17 +05:30
ips.go Sync all devices after initial pairing (#3047) 2023-01-06 20:21:14 +08:00
ports.go Change of strategy, using a for loop wait 2022-10-26 10:26:59 +01:00
qrops.go Re-organise the code to be more modular (#3172) 2023-03-01 17:23:17 +05:30
qrops_test.go Reconciled shared test components into servertest 2023-03-24 17:31:34 +00:00
server.go Reconciled duplicate cert funcs 2023-03-24 17:31:34 +00:00
server_media.go Re-organise the code to be more modular (#3172) 2023-03-01 17:23:17 +05:30
server_test.go init currentMessageState when sync protobuf.ContactUpdate (#3332) 2023-03-28 11:45:54 +08:00
timeout.go Improved Local Pairing Separation of Concerns (#3248) 2023-03-23 11:44:15 +00:00
timeout_test.go Added timeout functionality to Servers (#3192) 2023-02-15 15:50:30 +00:00