Documentation
¶
Index ¶
- func EnumerateFiles(folder string, testRegex *regexp.Regexp, recursive bool) ([]string, error)
- func GetConfigNameFromFileName(filename string) string
- func NewOutputRecorderFS(fs vfs.FS) vfs.FS
- func SetCompilerOptionsFromTestConfig(t *testing.T, testConfig TestConfiguration, ...)
- type CompilationOutput
- type CompilationResult
- func (r *CompilationResult) FS() vfs.FS
- func (c *CompilationResult) GetInputsAndOutputsForFile(path string) *CompilationOutput
- func (c *CompilationResult) GetInputsForFile(path string) []*TestFile
- func (r *CompilationResult) GetNumberOfJSFiles(includeJson bool) int
- func (c *CompilationResult) GetOutput(path string, kind string) *TestFile
- func (c *CompilationResult) GetSourceMapRecord() string
- func (c *CompilationResult) Inputs() []*TestFile
- func (c *CompilationResult) Outputs() []*TestFile
- type HarnessOptions
- type NamedTestConfiguration
- type OutputRecorderFS
- type SourceFileCacheKey
- type TestConfiguration
- type TestFile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnumerateFiles ¶
func SetCompilerOptionsFromTestConfig ¶
func SetCompilerOptionsFromTestConfig(t *testing.T, testConfig TestConfiguration, compilerOptions *core.CompilerOptions)
Types ¶
type CompilationOutput ¶
type CompilationResult ¶
type CompilationResult struct { Diagnostics []*ast.Diagnostic Result *compiler.EmitResult Program *compiler.Program Options *core.CompilerOptions HarnessOptions *HarnessOptions JS collections.OrderedMap[string, *TestFile] DTS collections.OrderedMap[string, *TestFile] Maps collections.OrderedMap[string, *TestFile] Symlinks map[string]string Repeat func(TestConfiguration) *CompilationResult // contains filtered or unexported fields }
func CompileFiles ¶
func CompileFiles( t *testing.T, inputFiles []*TestFile, otherFiles []*TestFile, testConfig TestConfiguration, tsconfig *tsoptions.ParsedCommandLine, currentDirectory string, symlinks map[string]string, ) *CompilationResult
func CompileFilesEx ¶
func CompileFilesEx( t *testing.T, inputFiles []*TestFile, otherFiles []*TestFile, harnessOptions *HarnessOptions, compilerOptions *core.CompilerOptions, currentDirectory string, symlinks map[string]string, tsconfig *tsoptions.ParsedCommandLine, ) *CompilationResult
func (*CompilationResult) FS ¶
func (r *CompilationResult) FS() vfs.FS
func (*CompilationResult) GetInputsAndOutputsForFile ¶
func (c *CompilationResult) GetInputsAndOutputsForFile(path string) *CompilationOutput
func (*CompilationResult) GetInputsForFile ¶
func (c *CompilationResult) GetInputsForFile(path string) []*TestFile
func (*CompilationResult) GetNumberOfJSFiles ¶
func (r *CompilationResult) GetNumberOfJSFiles(includeJson bool) int
func (*CompilationResult) GetOutput ¶
func (c *CompilationResult) GetOutput(path string, kind string) *TestFile
func (*CompilationResult) GetSourceMapRecord ¶
func (c *CompilationResult) GetSourceMapRecord() string
func (*CompilationResult) Inputs ¶
func (c *CompilationResult) Inputs() []*TestFile
func (*CompilationResult) Outputs ¶
func (c *CompilationResult) Outputs() []*TestFile
type HarnessOptions ¶
type HarnessOptions struct { AllowNonTsExtensions bool UseCaseSensitiveFileNames bool BaselineFile string IncludeBuiltFile string FileName string LibFiles []string NoErrorTruncation bool SuppressOutputPathCheck bool NoImplicitReferences bool CurrentDirectory string Symlink string Link string NoTypesAndSymbols bool FullEmitPaths bool NoCheck bool ReportDiagnostics bool CaptureSuggestions bool TypescriptVersion string }
type NamedTestConfiguration ¶
type NamedTestConfiguration struct { Name string Config TestConfiguration }
type OutputRecorderFS ¶
func (*OutputRecorderFS) Outputs ¶
func (fs *OutputRecorderFS) Outputs() []*TestFile
type SourceFileCacheKey ¶
type SourceFileCacheKey struct {
// contains filtered or unexported fields
}
func GetSourceFileCacheKey ¶
func GetSourceFileCacheKey(opts ast.SourceFileParseOptions, text string, scriptKind core.ScriptKind) SourceFileCacheKey
type TestConfiguration ¶
This maps a compiler setting to its string value, after splitting by commas, handling inclusions and exclusions, and deduplicating. For example, if a test file contains:
// @target: esnext, es2015
Then the map will map "target" to "esnext", and another map will map "target" to "es2015".
Click to show internal directories.
Click to hide internal directories.