# Learning Angular: Testing $q promise resolves with Sinon and Jasmine

DevFeed: [Learning Angular: Testing $q promise resolves with Sinon and Jasmine](<https://devfeed.tech/articles/learning-angular-testing-q-promise-resolves-with-sinon-and-jasmine-21246.md>)

Original publisher: [Read original article](<https://juri.dev/blog/2015/06/learning-ng-testing-promises/>)

Published: 2015-06-29T00:00:00Z

Content type: tutorial

Language: en

Sources: [Juri Strumpflohner](<https://devfeed.tech/sources/juri-strumpflohner.md>)

Topics: [Angular](<https://devfeed.tech/topics/angular.md>), [Jasmine](<https://devfeed.tech/topics/jasmine.md>), [Promise](<https://devfeed.tech/topics/promise.md>), [Testing](<https://devfeed.tech/topics/testing.md>)

Tags: [angular](<https://devfeed.tech/tags/angular.md>), [asynchronous](<https://devfeed.tech/tags/asynchronous.md>), [js](<https://devfeed.tech/tags/js.md>), [test](<https://devfeed.tech/tags/test.md>), [testing](<https://devfeed.tech/tags/testing.md>), [unit-test](<https://devfeed.tech/tags/unit-test.md>)

## AI overview

A tutorial showing how to mock and resolve an asynchronous Angular $q promise in a Jasmine unit test using Sinon.js. It explains stubbing the promise-returning function, observing another function's invocations, invoking the subject under test, and resolving the promise before checking expectations.

## Source excerpt

Lorem ipsum dolor sit amet