testutils¶
Index¶
- Variables
- func AssertGoldenJournals(t *testing.T, graph *logseq.Graph, caseDirName string, pages []string)
- func AssertGoldenPages(t *testing.T, graph *logseq.Graph, caseDirName string, pages []string)
- func AssertPagesDontExist(t *testing.T, graph *logseq.Graph, pages []string)
- func CaptureOutput(function func()) string
- func NewStubGraph(t *testing.T, subDir string) *logseq.Graph
- func RelativeTime() time.Time
- func StubBacklog(t *testing.T, configPage, caseDirName string, apiResponses *StubAPIResponses) backlog.Backlog
- func StubGraph(t *testing.T, caseDirName string) *logseq.Graph
- func assertGoldenContent(t *testing.T, graph *logseq.Graph, journals bool, caseDirName string, pages []string)
- func stubJSONResponse(t *testing.T, basename string) (string, error)
- type QueryArg
- type StubAPIResponses
- type mockLogseqAPI
- func newMockLogseqAPI(t *testing.T, responses StubAPIResponses) *mockLogseqAPI
- func (m *mockLogseqAPI) PostQuery(query string) (string, error)
Variables¶
func AssertGoldenJournals¶
func AssertGoldenPages¶
func AssertPagesDontExist¶
func CaptureOutput¶
CaptureOutput captures both stdout and stderr. It also works with the "color" package.
func NewStubGraph¶
NewStubGraph creates a test graph using the new directory structure. It uses graph-template as the base and loads test data from testdata/{subDir}/journals and testdata/{subDir}/pages.
func RelativeTime¶
func StubBacklog¶
Go
func StubBacklog(t *testing.T, configPage, caseDirName string, apiResponses *StubAPIResponses) backlog.Backlog
func StubGraph¶
StubGraph opens the example graph under "testdata" for testing.
Deprecated: Use NewStubGraph instead. This function will be removed in a future PR.
func assertGoldenContent¶
Go
func assertGoldenContent(t *testing.T, graph *logseq.Graph, journals bool, caseDirName string, pages []string)
func stubJSONResponse¶
type QueryArg¶
type StubAPIResponses¶
type mockLogseqAPI¶
func newMockLogseqAPI¶
func (*mockLogseqAPI) PostQuery¶
Generated by gomarkdoc