regou / angular-bsfy Goto Github PK
View Code? Open in Web Editor NEWA more elegant angular-browserify,and will always up to date
License: MIT License
A more elegant angular-browserify,and will always up to date
License: MIT License
I'm trying to do a basic test:
describe("My first angular-bsfy testing", function () {
var myApp= require('./myApp');
var elem, $scope;
beforeEach(angular.mock.module(myApp.name));
beforeEach(inject(['$rootScope', '$compile', function ($rootScope, $compile) {
$scope = $rootScope;
elem = angular.element('<div>{{2 + 2}}</div>');
$compile(elem)($rootScope);
}]));
it("should return 4", function () {
$scope.$apply();
expect(elem.html()).toBe("4");
});
});
but if I use angular-mock you have into angular-bsfy I get this error:
Chrome 35.0.1916 (Windows 7) My first angular-bsfy testing should return 4 FAILED
Error: [$injector:unpr] Unknown provider: aProvider <- a <- $timeout <- $animate <- $compile
http://errors.angularjs.org/1.2.17/$injector/unpr?p0=aProvider%20%3C-%20a%20%3C-%20%24timeout%20%3C-%20%24animate%20%3C-%20%24compile
at C:/Users/u100527/AppData/Local/Temp/658a102e3ee87fb492ad32c65edab6ea5e13f65b.browserify?13ca717b0c07679cd39f7d11c6d1713e3466eea0:15:675
at C:/Users/u100527/AppData/Local/Temp/658a102e3ee87fb492ad32c65edab6ea5e13f65b.browserify?13ca717b0c07679cd39f7d11c6d1713e3466eea0:15:17101
at Object.c [as get] (C:/Users/u100527/AppData/Local/Temp/658a102e3ee87fb492ad32c65edab6ea5e13f65b.browserify?13ca717b0c07679cd39f7d11c6d1713e3466eea0:15:16366)
at C:/Users/u100527/AppData/Local/Temp/658a102e3ee87fb492ad32c65edab6ea5e13f65b.browserify?13ca717b0c07679cd39f7d11c6d1713e3466eea0:15:17196
at c (C:/Users/u100527/AppData/Local/Temp/658a102e3ee87fb492ad32c65edab6ea5e13f65b.browserify?13ca717b0c07679cd39f7d11c6d1713e3466eea0:15:16366)
at Object.d [as invoke] (C:/Users/u100527/AppData/Local/Temp/658a102e3ee87fb492ad32c65edab6ea5e13f65b.browserify?13ca717b0c07679cd39f7d11c6d1713e3466eea0:15:16651)
at Lc.c.$get (C:/Users/u100527/AppData/Local/Temp/658a102e3ee87fb492ad32c65edab6ea5e13f65b.browserify?13ca717b0c07679cd39f7d11c6d1713e3466eea0:15:15637)
at Object.d [as invoke] (C:/Users/u100527/AppData/Local/Temp/658a102e3ee87fb492ad32c65edab6ea5e13f65b.browserify?13ca717b0c07679cd39f7d11c6d1713e3466eea0:15:16686)
at C:/Users/u100527/AppData/Local/Temp/658a102e3ee87fb492ad32c65edab6ea5e13f65b.browserify?13ca717b0c07679cd39f7d11c6d1713e3466eea0:15:17214
at c (C:/Users/u100527/AppData/Local/Temp/658a102e3ee87fb492ad32c65edab6ea5e13f65b.browserify?13ca717b0c07679cd39f7d11c6d1713e3466eea0:15:16366)
Error: Declaration Location
at a.inject.b.mock.inject (C:/Users/u100527/AppData/Local/Temp/658a102e3ee87fb492ad32c65edab6ea5e13f65b.browserify?13ca717b0c07679cd39f7d11c6d1713e3466eea0:12:14502)
at null.<anonymous> (C:/Users/u100527/AppData/Local/Temp/658a102e3ee87fb492ad32c65edab6ea5e13f65b.browserify?13ca717b0c07679cd39f7d11c6d1713e3466eea0:38:16)
at Object.require.l7Q0ws../afp-collapse-module (C:/Users/u100527/AppData/Local/Temp/658a102e3ee87fb492ad32c65edab6ea5e13f65b.browserify?13ca717b0c07679cd39f7d11c6d1713e3466eea0:33:1)
at s (C:/Users/u100527/AppData/Local/Temp/658a102e3ee87fb492ad32c65edab6ea5e13f65b.browserify?13ca717b0c07679cd39f7d11c6d1713e3466eea0:1:228)
at e (C:/Users/u100527/AppData/Local/Temp/658a102e3ee87fb492ad32c65edab6ea5e13f65b.browserify?13ca717b0c07679cd39f7d11c6d1713e3466eea0:1:399)
at C:/Users/u100527/AppData/Local/Temp/658a102e3ee87fb492ad32c65edab6ea5e13f65b.browserify?13ca717b0c07679cd39f7d11c6d1713e3466eea0:1:417
TypeError: Cannot read property '$apply' of undefined
at null.<anonymous> (C:/Users/u100527/AppData/Local/Temp/658a102e3ee87fb492ad32c65edab6ea5e13f65b.browserify?13ca717b0c07679cd39f7d11c6d1713e3466eea0:46:15)
Chrome 35.0.1916 (Windows 7): Executed 1 of 1 (1 FAILED) ERROR (0.03 secs / 0.027 secs)
But if I change the require to point to the not minicicated angular-mock file insteand, it works fine.
Is it possible to use the non-minified version when not in the production environment?Maybe by detecting the presence of process.env.NODE_ENV and using the non-minified libraries if NODE_ENV !== 'production'. I'm using envify btw.
Hi. Are you still planning to keep this up-to-date? The latest is 1.3.11 already. Thank you.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.