Files
test-repo/tests/test_declarations/angularjs_inject.js
T
Georgii Dolzhykov c6e8177282 Inline AngularJS tests that use inject (#4495)
* Inline AngularJS tests that use `inject`

See https://docs.angularjs.org/guide/unit-testing#using-beforeall- for a code example.

* More meaningful function name, minor refactoring

* Linting

* Minor regexp improvement

* address review comments
2018-05-17 12:09:20 -03:00

27 lines
744 B
JavaScript

beforeEach(inject(($fooService, $barService) => {
// code
}));
afterAll(inject(($fooService, $barService) => {
console.log('Hello');
}));
it('should create the app', inject(($fooService, $barService) => {
//code
}));
it("does something really long and complicated so I have to write a very long name for the test", inject(() => {
// code
}));
it("does something really long and complicated so I have to write a very long name for the test", inject(($fooServiceLongName, $barServiceLongName) => {
// code
}));
/*
* isTestCall(parent) should only be called when parent exists
* and parent.type is CallExpression. This test makes sure that
* no errors are thrown when calling isTestCall(parent)
*/
function x() { inject(() => {}) }