MCPcopy Create free account
hub / github.com/Effect-TS/tsgo / TestResolveForFile_ExcludeOnlyAffectsCurrentScope

Function TestResolveForFile_ExcludeOnlyAffectsCurrentScope

etscore/options_test.go:141–165  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

139}
140
141func TestResolveForFile_ExcludeOnlyAffectsCurrentScope(t *testing.T) {
142 opts := &etscore.EffectPluginOptions{
143 Diagnostics: true,
144 DiagnosticSeverity: map[string]etscore.Severity{"deterministicKeys": etscore.SeverityError},
145 Overrides: []etscore.Override{
146 {
147 Exclude: []string{"generated/**/*.ts"},
148 Options: etscore.OverrideOptions{
149 DiagnosticSeverity: map[string]etscore.Severity{"deterministicKeys": etscore.SeverityWarning},
150 },
151 },
152 {
153 Include: []string{"generated/**/*.ts"},
154 Options: etscore.OverrideOptions{
155 DiagnosticSeverity: map[string]etscore.Severity{"deterministicKeys": etscore.SeverityOff},
156 },
157 },
158 },
159 }
160
161 resolvedSeverity := pluginoptions.ResolveDiagnosticSeverityForFile(opts, "/repo/generated/example.ts", "/repo/tsconfig.json", true)
162 if got := resolvedSeverity["deterministicKeys"]; got != etscore.SeverityOff {
163 t.Errorf("deterministicKeys severity = %v, want %v", got, etscore.SeverityOff)
164 }
165}
166
167func intPtr(value int) *int {
168 return &value

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected