plugeth/internal/jsre
Eng Zer Jun 8d066f1f42
all: use T.TempDir to create temporary test directories (#24633)
This commit replaces ioutil.TempDir 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 ioutil.TempDir
had 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>
2022-04-08 15:44:55 +02:00
..
deps eth: request id dispatcher and direct req/reply APIs (#23576) 2021-11-26 13:26:03 +02:00
completion_test.go go.mod: upgrade goja (#23721) 2021-10-13 14:42:00 +02:00
completion.go internal/jsre: handle null and undefined to prevent crash (#23701) 2021-10-10 14:58:47 +02:00
jsre_test.go all: use T.TempDir to create temporary test directories (#24633) 2022-04-08 15:44:55 +02:00
jsre.go cmd/geth, console: support interrupting the js console (#23387) 2021-12-11 16:51:05 +01:00
pretty.go console, internal/jsre: use github.com/dop251/goja (#20470) 2020-01-27 11:50:48 +01:00