Skip to content

Commit 176a63f

Browse files
committed
Dont baseline trace with old
1 parent ab0124b commit 176a63f

File tree

179 files changed

+5
-11604
lines changed

Some content is hidden

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

179 files changed

+5
-11604
lines changed

internal/testrunner/compiler_runner.go

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -519,37 +519,9 @@ func (c *compilerTest) verifyModuleResolution(t *testing.T, suiteName string, is
519519
t.Run("module resolution", func(t *testing.T) {
520520
defer testutil.RecoverAndFail(t, "Panic on creating module resolution baseline for test "+c.filename)
521521
tsbaseline.DoModuleResolutionBaseline(t, c.configuredName, c.result.Trace, baseline.Options{
522-
Subfolder: suiteName,
523-
IsSubmodule: isSubmodule,
524-
DiffFixupOld: func(old string) string {
525-
var sb strings.Builder
526-
sb.Grow(len(old))
527-
528-
removeLibReplacement := c.options.LibReplacement == core.TSUnknown
529-
inLibResolution := false
530-
for line := range strings.SplitSeq(old, "\n") {
531-
if line == "[" || line == "]" {
532-
continue
533-
}
534-
fixedLine := strings.TrimSuffix(strings.TrimPrefix(line, ` "`), `",`)
535-
if removeLibReplacement {
536-
if inLibResolution {
537-
if strings.HasPrefix(fixedLine, `======== Module name '@typescript/lib-`) {
538-
inLibResolution = false
539-
}
540-
continue
541-
}
542-
if strings.HasPrefix(fixedLine, `======== Resolving module '@typescript/lib-`) {
543-
inLibResolution = true
544-
continue
545-
}
546-
}
547-
sb.WriteString(fixedLine)
548-
sb.WriteString("\n")
549-
}
550-
551-
return sb.String()[:sb.Len()-1]
552-
},
522+
Subfolder: suiteName,
523+
IsSubmodule: isSubmodule,
524+
SkipDiffWithOld: true,
553525
})
554526
})
555527
}

internal/testutil/baseline/baseline.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ type Options struct {
2323
IsSubmodule bool
2424
IsSubmoduleAccepted bool
2525
DiffFixupOld func(string) string
26+
SkipDiffWithOld bool
2627
}
2728

2829
const NoContent = "<no content>"
@@ -42,7 +43,7 @@ func Run(t *testing.T, fileName string, actual string, opts Options) {
4243
writeComparison(t, actual, localPath, referencePath, false)
4344
}
4445

45-
if !opts.IsSubmodule {
46+
if !opts.IsSubmodule || opts.SkipDiffWithOld {
4647
// Not a submodule, no diffs.
4748
return
4849
}

testdata/baselines/reference/submodule/compiler/allowJsCrossMonorepoPackage.trace.json.diff

Lines changed: 0 additions & 50 deletions
This file was deleted.

testdata/baselines/reference/submodule/compiler/cachedModuleResolution1.trace.json.diff

Lines changed: 0 additions & 50 deletions
This file was deleted.

testdata/baselines/reference/submodule/compiler/cachedModuleResolution2.trace.json.diff

Lines changed: 0 additions & 50 deletions
This file was deleted.

testdata/baselines/reference/submodule/compiler/cachedModuleResolution3.trace.json.diff

Lines changed: 0 additions & 74 deletions
This file was deleted.

0 commit comments

Comments
 (0)