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
device_test.go
handlers.go Re-organise the code to be more modular (#3172) 2023-03-01 17:23:17 +05:30
ips.go
ports.go
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