2023-04-19 21:58:48 +05:30
|
|
|
package installer
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"testing"
|
|
|
|
|
|
2023-10-17 17:44:13 +05:30
|
|
|
"github.com/projectdiscovery/nuclei/v3/pkg/catalog/config"
|
2023-04-19 21:58:48 +05:30
|
|
|
"github.com/projectdiscovery/utils/generic"
|
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func TestVersionCheck(t *testing.T) {
|
|
|
|
|
err := NucleiVersionCheck()
|
|
|
|
|
require.Nil(t, err)
|
|
|
|
|
cfg := config.DefaultConfig
|
|
|
|
|
if generic.EqualsAny("", cfg.LatestNucleiIgnoreHash, cfg.LatestNucleiVersion, cfg.LatestNucleiTemplatesVersion) {
|
|
|
|
|
// all above values cannot be empty
|
|
|
|
|
t.Errorf("something went wrong got empty response nuclei-version=%v templates-version=%v ignore-hash=%v", cfg.LatestNucleiVersion, cfg.LatestNucleiTemplatesVersion, cfg.LatestNucleiIgnoreHash)
|
|
|
|
|
}
|
|
|
|
|
}
|