github.com/projectdiscovery/nuclei/v2@v2.9.15/internal/installer/versioncheck_test.go (about)

     1  package installer
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/projectdiscovery/nuclei/v2/pkg/catalog/config"
     7  	"github.com/projectdiscovery/utils/generic"
     8  	"github.com/stretchr/testify/require"
     9  )
    10  
    11  func TestVersionCheck(t *testing.T) {
    12  	err := NucleiVersionCheck()
    13  	require.Nil(t, err)
    14  	cfg := config.DefaultConfig
    15  	if generic.EqualsAny("", cfg.LatestNucleiIgnoreHash, cfg.LatestNucleiVersion, cfg.LatestNucleiTemplatesVersion) {
    16  		// all above values cannot be empty
    17  		t.Errorf("something went wrong got empty response nuclei-version=%v templates-version=%v ignore-hash=%v", cfg.LatestNucleiVersion, cfg.LatestNucleiTemplatesVersion, cfg.LatestNucleiIgnoreHash)
    18  	}
    19  }