Search in sources :

Example 1 with Direction

use of cz.habarta.typescript.generator.EnumTest.Direction in project typescript-generator by vojtechhabarta.

the class EnumConstantsExtensionTest method testInTypeScriptGenerator.

@Test
public void testInTypeScriptGenerator() {
    final Settings settings = new Settings();
    settings.newline = "\n";
    settings.outputFileType = TypeScriptFileType.implementationFile;
    settings.outputKind = TypeScriptOutputKind.global;
    settings.jsonLibrary = JsonLibrary.jackson2;
    settings.extensions.add(new EnumConstantsExtension());
    final String actual = new TypeScriptGenerator(settings).generateTypeScript(Input.from(Direction.class));
    Assert.assertTrue(actual.contains("const Direction"));
    Assert.assertTrue(actual.contains("North"));
}
Also used : EnumConstantsExtension(cz.habarta.typescript.generator.ext.EnumConstantsExtension) Direction(cz.habarta.typescript.generator.EnumTest.Direction) Test(org.junit.Test)

Aggregations

Direction (cz.habarta.typescript.generator.EnumTest.Direction)1 EnumConstantsExtension (cz.habarta.typescript.generator.ext.EnumConstantsExtension)1 Test (org.junit.Test)1