(t *testing.T)
| 169 | } |
| 170 | |
| 171 | func 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 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…