JSFiddle - React, Tailwind, and code Playground
by adelura
JavaScript
let $rootScope,
$compile,
$document;
beforeEach(inject(function (_$compile_, $document, _$rootScope_) {
$rootScope = _$rootScope_;
$compile = _$compile_;
$document = _$document_;
}));
describe("shomething", function () {
it("should", function () {
console.log($rootScope);
});
});
// vs
let inj = {};
// it will automatically assing injections into `inj` object.
beforeEach(penInject('$compile', '$document', '$rootScope', inj));
describe("shomething", function () {
it("should", function () {
console.log(inj.$rootScope);
});
});