linemanjs / lineman-angular-template

A Lineman Application Template using AngularJS
251 stars 88 forks source link

Add angular-mocks to spec/helpers #1

Closed dennisburton closed 11 years ago

dennisburton commented 11 years ago

Library needed for writing specs against angular apps

fastone commented 11 years ago

How can we use this to write tests ?

davemo commented 11 years ago

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.

davemo commented 11 years ago

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.