@Test
void asJavascript() {

  Trace trace = ScatterTrace.builder(x, y).build();
  Figure figure = new Figure(trace);
  assertEquals(
      "    <script>\n"
          + "        var target_target = document.getElementById('target');\n"
          + "        \n"
          + "var trace0 =\n"
          + "{\n"
          + "x: [\"1.0\",\"2.0\",\"3.0\",\"4.0\",\"5.0\"],\n"
          + "y: [\"1.0\",\"4.0\",\"9.0\",\"16.0\",\"25.0\"],\n"
          + "mode: 'markers',\n"
          + "xaxis: 'x',\n"
          + "yaxis: 'y',\n"
          + "type: 'scatter',\n"
          + "name: '',\n"
          + "};\n"
          + "\n"
          + "        var data = [ trace0];\n"
          + "Plotly.newPlot(target_target, data);            </script>\n",
      figure.asJavascript(divName));
}