MCPcopy Index your code
hub / github.com/github/gh-aw / TestFormatJavaScriptForYAMLProducesValidIndentation

Function TestFormatJavaScriptForYAMLProducesValidIndentation

pkg/workflow/js_test.go:237–250  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

235}
236
237func 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
252func TestWriteJavaScriptToYAMLProducesValidIndentation(t *testing.T) {
253 script := "const x = 1;\nif (x > 0) {\n console.log('positive');\n}"

Callers

nothing calls this directly

Calls 2

FormatJavaScriptForYAMLFunction · 0.85
ErrorfMethod · 0.45

Tested by

no test coverage detected