(t *testing.T)
| 235 | } |
| 236 | |
| 237 | func TestFormatJavaScriptForYAMLProducesValidIndentation(t *testing.T) { |
| 238 | script := "const x = 1;\nif (x > 0) {\n console.log('positive');\n}" |
| 239 | result := FormatJavaScriptForYAML(script) |
| 240 | |
| 241 | // Check that all lines start with proper indentation (12 spaces) |
| 242 | for i, line := range result { |
| 243 | if !strings.HasPrefix(line, " ") { |
| 244 | t.Errorf("Line %d does not start with proper indentation: %q", i, line) |
| 245 | } |
| 246 | if !strings.HasSuffix(line, "\n") { |
| 247 | t.Errorf("Line %d does not end with newline: %q", i, line) |
| 248 | } |
| 249 | } |
| 250 | } |
| 251 | |
| 252 | func TestWriteJavaScriptToYAMLProducesValidIndentation(t *testing.T) { |
| 253 | script := "const x = 1;\nif (x > 0) {\n console.log('positive');\n}" |
nothing calls this directly
no test coverage detected