(t *testing.T)
| 139 | } |
| 140 | |
| 141 | func 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 | |
| 167 | func intPtr(value int) *int { |
| 168 | return &value |
nothing calls this directly
no test coverage detected