package customtemplates import ( "context" "path/filepath" "testing" "github.com/projectdiscovery/gologger" "github.com/projectdiscovery/nuclei/v3/pkg/catalog/config" "github.com/projectdiscovery/nuclei/v3/pkg/testutils" osutils "github.com/projectdiscovery/utils/os" "github.com/stretchr/testify/require" ) func TestDownloadCustomTemplatesFromGitHub(t *testing.T) { if osutils.IsOSX() { t.Skip("skipping on macos due to unknown failure (works locally)") } gologger.DefaultLogger.SetWriter(&testutils.NoopWriter{}) templatesDirectory := t.TempDir() config.DefaultConfig.SetTemplatesDir(templatesDirectory) options := testutils.DefaultOptions options.GitHubTemplateRepo = []string{"projectdiscovery/nuclei-templates-test"} ctm, err := NewCustomTemplatesManager(options) require.Nil(t, err, "could not create custom templates manager") ctm.Download(context.Background()) require.DirExists(t, filepath.Join(templatesDirectory, "github", "projectdiscovery", "nuclei-templates-test"), "cloned directory does not exists") }