This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
NgMock: Useful this
value in module config #15162
Open
Description
Note: for support questions, please use one of these channels: https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#question. This repository's issues are reserved for feature requests and bug reports.
Do you want to request a feature or report a bug?
feature
What is the current behavior?
The this
value of a config function passed to the module
function is currently either window
or undefined
depending on your use strict
state.
beforeEach(module('myApp', function($compileProvider) {
// `window` or `undefined`
console.log(this);
}));
What is the expected behavior?
Can we provide the this
value from beforeEach
so that this
is the current spec in any config functions?
What is the motivation / use case for changing the behavior?
Ease of testability when using this
to share content that should be spec specific