Last active
December 28, 2015 20:52
-
-
Save alexanderfrankel/0a7d33349b564b5f179e to your computer and use it in GitHub Desktop.
testing-in-karma-dot-only.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe.only('MyController', function() { | |
// define some variables | |
var scope, httpBackend, myController; | |
// load in our app | |
beforeEach(module('MyApp')); | |
// code to execute before each of our tests | |
beforeEach(inject(function($rootScope, $httpBackend, $controller) { | |
httpBackend = $httpBackend; | |
scope = $rootScope.$new(); | |
myController = $controller('MyController', {$scope: scope}); | |
// simulates a GET request to our server | |
httpBackend.when('GET', '/students') | |
.respond({students: [{name: "alex", grade: "third"}, | |
{name: "tom", grade: "second"}, | |
{name: "silvio", grade: "first"} | |
]}); | |
httpBackend.flush(); | |
})); | |
... | |
)}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment