function inject(fn) {
  return function() {

    if (!DIAGRAM_JS) {
      throw new Error('no bootstraped diagram, ensure you created it via #bootstrapDiagram');
    }

    return DIAGRAM_JS.invoke(fn);
  };
}
Injects services of an instantiated diagram into the argument.

Use it in conjunction with {@link #bootstrapDiagram}.

@example

```javascript
describe(function() {

  var mockEvents;

  beforeEach(bootstrapDiagram(...));

  it('should provide mocked events', inject(function(events) {
    expect(events).toBe(mockEvents);
  }));

});
```

@param {Function} fn the function to inject to
@return {Function} a function that can be passed to it to carry out the injection