Documentation
¶
Index ¶
- Variables
- func Cleanup()
- func GenerateBadMultiConfig(domain string) error
- func GenerateConfig(domain string, valid bool) error
- func GenerateJSONConfig(domain string) error
- func GenerateProject() error
- func GenerateProxyConfig(domain string) error
- func Setup()
- func TouchFixtureFile(path, content string) error
- type Server
Constants ¶
This section is empty.
Variables ¶
var ( // FixturesPath is the path that any files make during testing will be put under FixturesPath = filepath.Join(".", "fixtures") // FixtureProjectPath is a directory where any projects files will be put FixtureProjectPath = filepath.Join(FixturesPath, "project") // UpdateFilePath is the file for testing updating themekit UpdateFilePath = filepath.Join(FixturesPath, "updateme") // NewUpdateFile is the file that is sent for updating themekit NewUpdateFile = []byte{0x01, 0x02, 0x03, 0x04, 0x05, 0x06} // NewUpdateFileChecksum is the checksum for newupdatefile NewUpdateFileChecksum = md5.Sum(NewUpdateFile) )
var ProjectFiles = []string{ filepath.Join("assets", "application.js"), filepath.Join("assets", "pixel.png"), filepath.Join("config", "settings_data.json"), filepath.Join("layout", ".gitkeep"), filepath.Join("locales", "en.json"), filepath.Join("snippets", "snippet.js"), filepath.Join("templates", "template.liquid"), filepath.Join("templates", "customers", "test.liquid"), }
ProjectFiles are the files that are generated for project fixtures
var (
// ReleaseAtom is a atom release for testing release selection
ReleaseAtom, _ = atom.LoadFeed(strings.NewReader(releaseAtom))
)
var SymlinkProjectPath = filepath.Join(FixturesPath, "sym_project")
SymlinkProjectPath is the path the the symlink to test project symlinks
Functions ¶
func GenerateBadMultiConfig ¶
GenerateBadMultiConfig will generate a config using the passed domain with proxy config, but with one invalid environment
func GenerateConfig ¶
GenerateConfig will generate a config using the passed domain. To test invalid config pass false to valid.
func GenerateJSONConfig ¶
GenerateJSONConfig will generate and write a valid json config for testing
func GenerateProject ¶
func GenerateProject() error
GenerateProject will generate a fake project of fixtures for testing
func GenerateProxyConfig ¶
GenerateProxyConfig will generate a config using the passed domain with proxy config.
func Setup ¶
func Setup()
Setup will generate all the project files and directories needed for testing kit and cmd
func TouchFixtureFile ¶
TouchFixtureFile will create a fixture in the fixture project path.
Types ¶
type Server ¶
type Server struct { *httptest.Server Requests []*http.Request // contains filtered or unexported fields }
Server is a test server that will record requests and server shopify responses
func NewTestServer ¶
func NewTestServer() *Server
NewTestServer is test server setup to act like the shopify API so that we can test against it for different responses