testutil

package
v0.0.0-...-1b94cb7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 20, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TemplateCache = NewBaseTemplateCache()

Functions

func CleanupBaseTest

func CleanupBaseTest(testWd string, logger *zap.Logger) error

Generic test to cleanup the working directory and logger.

func CreateTemplate

func CreateTemplate(t *testing.T, baseTemplate string, writer io.Writer)

Creates the next.js typescript template

func CreateTestDirAndLogger

func CreateTestDirAndLogger(testDir string) (*zap.Logger, string, error)

Creates test directory and logger. Returns the logger, test working directory path, or error

func GetLogs

func GetLogs(logFilePath string) (string, error)

Reads the log file as a string

Types

type BaseTemplateCache

type BaseTemplateCache struct {
	TemplatePaths map[string]string
	// contains filtered or unexported fields
}

func NewBaseTemplateCache

func NewBaseTemplateCache() *BaseTemplateCache

func (*BaseTemplateCache) AddTemplate

func (c *BaseTemplateCache) AddTemplate(templateName, templatePath string)

Adds template to the cache. Will update any template reservations in InProgressTemplates if applicable.

func (*BaseTemplateCache) GetTemplateAndCopy

func (c *BaseTemplateCache) GetTemplateAndCopy(selectedTemplate, outputDir string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL