From 37722428e5c5f81e53d895925c5e538452bc6a20 Mon Sep 17 00:00:00 2001 From: oleiade Date: Wed, 8 Nov 2023 10:22:12 +0100 Subject: [PATCH] Fix tests --- js/modules/k6/experimental/fs/file.go | 2 +- js/modules/k6/experimental/fs/module_test.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/js/modules/k6/experimental/fs/file.go b/js/modules/k6/experimental/fs/file.go index 40b96174226d..2fcde11ce924 100644 --- a/js/modules/k6/experimental/fs/file.go +++ b/js/modules/k6/experimental/fs/file.go @@ -35,7 +35,7 @@ type FileInfo struct { Name string `json:"name"` // Size holds the size of the file in bytes. - Size int `json:"size"` + Size int64 `json:"size"` } // Read reads up to len(into) bytes into the provided byte slice. diff --git a/js/modules/k6/experimental/fs/module_test.go b/js/modules/k6/experimental/fs/module_test.go index 7fc62420fbc7..5bb8b2202477 100644 --- a/js/modules/k6/experimental/fs/module_test.go +++ b/js/modules/k6/experimental/fs/module_test.go @@ -577,10 +577,10 @@ func TestOpenImpl(t *testing.T) { cache: &cache{}, } - assert.Panics(t, func() { - //nolint:errcheck,gosec - mi.openImpl(testFileName) - }) + f, gotErr := mi.openImpl(testFileName) + + assert.Error(t, gotErr) + assert.Nil(t, f) }) t.Run("should return an error if the file does not exist", func(t *testing.T) {