Closed dennisburton closed 11 years ago
How can we use this to write tests ?
Hi @fastone, I plan to do a screencast on using angular-mocks in the future, but for right now perhaps this gist can get you up and running and answer some questions for you: https://gist.github.com/davemo/5396706
It covers a simple angular controller, and a spec using module
and inject
to properly setup the system under test.
The spec is written using a higher level library called jasmine-given
, but the syntax is pretty simple and if you're familiar with jasmine
or mocha
spec runners you can use a similar technique using describe
, beforeEach
, and it
to structure your tests.
Library needed for writing specs against angular apps