function compile( template ){
    var node = $compile('<div>' + template + '</div>')($rootScope);
    $rootScope.$digest();
    return node.contents();
  }
This directive uses transclusion so for testing purposes we have to
wrap the tested element in a wrapping div and then fetch its
contents. See:
Testing Transclusion Directives @ https://docs.angularjs.org/guide/unit-testing