A service mocking library for Angular testing
cmstead / mocular Goto Github PK
View Code? Open in Web Editor NEWA service mocking library for Angular testing
A service mocking library for Angular testing
Fix:
function verifyExpectation(name, args) {
var nameIsCorrect = (name === expectation.name),
argumentsAreCorrect = verifyArguments(args),
expectationCurrentValue = expectation.isMet;
expectation.isMet = (expectationCurrentValue) ? expectationCurrentValue : (nameIsCorrect && argumentsAreCorrect);
if (expectation.isMet) {
resetExpectation();
expectation.isMet = true;
}
}
Mocular monkey-patches objects to stub functions. Currently, this stubbing is persisted in memory throughout the lifecycle of the test run. This should be reset-able on afterEach via a clean function.
Currently default data is overwritten when a test instance changes the definition. The two should be separate so default data is always returned.
Promises should always default to resolve unless explicitly set to reject. Currently resolution status lingers after a test.
Data should get wrapped without the user knowing the inner workings. It's just too much to think about when it really shouldn't matter to the user in the end.
Expectations currently linger and they should be reset so each test is independent.
Fix:
functionBody.apply(this, Array.prototype.slice.call(arguments, 0));
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.