From 99be8e4ea70a587b87d549b82dc7fb91e3d64a17 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Wed, 6 Apr 2022 16:10:42 +0200 Subject: [PATCH] server: make i18n test more robust (#212) It breaks on macOS 11. --- server/i18n_test.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/server/i18n_test.go b/server/i18n_test.go index d7e8c69..dd0296b 100644 --- a/server/i18n_test.go +++ b/server/i18n_test.go @@ -6,6 +6,7 @@ import ( "os" "path/filepath" "testing" + "strings" "github.com/mattermost/mattermost-server/v5/plugin/plugintest" "github.com/stretchr/testify/mock" @@ -49,9 +50,7 @@ func TestTranslationsPreInit(t *testing.T) { p := &Plugin{} p.API = api err = p.TranslationsPreInit() - require.True(t, err.Error() == "unable to read i18n directory: readdirent: invalid argument" || - err.Error() == "unable to read i18n directory: readdirent: not a directory" || - err.Error() == "unable to read i18n directory: fdopendir: not a directory") + require.True(t, strings.Contains(err.Error(), "unable to read i18n directory")) })