Skip to content

Commit 0ca5839

Browse files
authored
Ignore baseline diffs that use unsupported options (#736)
1 parent 7a8ec61 commit 0ca5839

File tree

150 files changed

+21
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

150 files changed

+21
-1
lines changed

internal/testrunner/compiler_runner.go

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ func (c *compilerTest) verifyDiagnostics(t *testing.T, suiteName string, isSubmo
341341
tsbaseline.DoErrorBaseline(t, c.configuredName, files, c.result.Diagnostics, c.result.Options.Pretty.IsTrue(), baseline.Options{
342342
Subfolder: suiteName,
343343
IsSubmodule: isSubmodule,
344-
IsSubmoduleAccepted: len(c.result.Program.UnsupportedExtensions()) != 0, // TODO(jakebailey): read submoduleAccepted.txt
344+
IsSubmoduleAccepted: c.containsUnsupportedOptions(),
345345
})
346346
})
347347
}
@@ -434,3 +434,21 @@ func (c *compilerTest) verifyUnionOrdering(t *testing.T) {
434434
}
435435
})
436436
}
437+
438+
func (c *compilerTest) containsUnsupportedOptions() bool {
439+
if len(c.result.Program.UnsupportedExtensions()) != 0 {
440+
return true
441+
}
442+
switch c.options.GetEmitModuleKind() {
443+
case core.ModuleKindAMD, core.ModuleKindUMD, core.ModuleKindSystem:
444+
return true
445+
}
446+
if c.options.BaseUrl != "" {
447+
return true
448+
}
449+
if c.options.RootDirs != nil {
450+
return true
451+
}
452+
453+
return false
454+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)