MCPcopy Index your code
hub / github.com/coder/guts / TestNotNullMaps

Function TestNotNullMaps

convert_test.go:171–193  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

169}
170
171func TestNotNullMaps(t *testing.T) {
172 gen, err := guts.NewGolangParser()
173 require.NoError(t, err, "new convert")
174
175 dir := filepath.Join(".", "testdata", "maps")
176 err = gen.IncludeGenerate("./" + dir)
177 require.NoErrorf(t, err, "include %q", dir)
178
179 gen.IncludeCustomDeclaration(config.StandardMappings())
180
181 ts, err := gen.ToTypescript()
182 require.NoError(t, err, "to typescript")
183
184 ts.ApplyMutations(
185 config.NotNullMaps,
186 )
187
188 output, err := ts.Serialize()
189 require.NoErrorf(t, err, "generate %q", dir)
190
191 // Not perfect, this asserts if the record is a nullable type.
192 require.Contains(t, output, "SimpleMap: Record<string, string>;", "no nullable Record")
193}

Callers

nothing calls this directly

Calls 7

NewGolangParserFunction · 0.92
StandardMappingsFunction · 0.92
IncludeGenerateMethod · 0.80
ToTypescriptMethod · 0.80
ApplyMutationsMethod · 0.80
SerializeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…