tomyam1 / angular Goto Github PK
View Code? Open in Web Editor NEWThis project forked from bclinkinbeard/angular
AngularJS compiled with jsdom and provided as a CommonJS module. Intended for testing AngularJS code without depending on a browser.
This project forked from bclinkinbeard/angular
AngularJS compiled with jsdom and provided as a CommonJS module. Intended for testing AngularJS code without depending on a browser.
Not trivial at all.
This is what a I came up with.
Issues:
// Monkey-patch arround angular-mocks to support
var origBeforeEach = beforeEach,
origAfterEach = afterEach,
beforeSpec, afterSpec;
window.beforeEach = function (fn) {
if (beforeSpec) {
throw new Error('beforeEach was called a second time by angular-mocks');
}
beforeSpec = fn;
}
window.afterEach = function (fn) {
if (afterSpec) {
throw new Error('afterEach was called a second time by angular-mocks');
}
afterSpec = fn;
}
require(paths.ngMocks);
if (!beforeSpec) {
throw new Error('beforeEach was not called by angular-mocks');
}
if (!afterSpec) {
throw new Error('afterEach was not called by angular-mocks');
}
window.beforeEach = origBeforeEach;
window.afterEach = origAfterEach;
// prepare injector for beforeAll blocks
beforeAll(beforeSpec);
// clear inspector before the first spec
var isFirst = true;
beforeEach(function() {
if (isFirst) {
isFirst = false;
afterSpec();
}
});
// prepare injector for the afterAll blocks
afterAll(beforeSpec);
// prepare and clear injector for each spec
beforeEach(beforeSpec);
afterEach(afterSpec);
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.