pulumi/sdk/nodejs/cmd/pulumi-language-nodejs
Eng Zer Jun 48eff4676a
test: use T.TempDir to create temporary test directory
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`
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>
2022-12-03 15:17:08 +08:00
..
main.go Engine and Golang support for shimless providers 2022-11-14 11:25:41 +00:00
main_test.go test: use T.TempDir to create temporary test directory 2022-12-03 15:17:08 +08:00
proxy.go Monitor.Invoke and Provider.Invoke take different arguments (#9323) 2022-04-14 10:59:46 +01:00
proxy_unix.go Fix lint (#7915) 2021-09-07 16:41:17 -04:00
proxy_windows.go ci: gofmt 1.18+ clean 2022-09-21 09:48:39 -07:00