I am using angular-datatables in my project and I would like to write a Jasmine/Karma unit test for it.
This is code from my controller:
$scope.dtOptions = DTOptionsBuilder.fromSource('/api/books/')
.withBootstrap()
.withPaginationType('simple_numbers')
.withDisplayLength(10)
//.withOption('serverSide', true)
.withOption('processing', true)
.withOption('createdRow', createdRow);
$scope.dtColumns = [
DTColumnBuilder.newColumn('id').withTitle('ID'),
DTColumnBuilder.newColumn('name').withTitle('Name')
DTColumnBuilder.newColumn(null).withTitle('Actions').notSortable()
.renderWith(actionsHtml)
];
How can I now write a unit test for it, faking a JSON response from /api/books
?