-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Any documentation how to use the package would be highly appreciated #12
Comments
Hi igalep, did you ever resolve this issue? I'm trying to use jasmine.async and encountering the same error. |
I put together a video showing this librarie's usage in a requirejs project - maybe that will help :). My strategy was to copy the code into my code base instead of trying to bower or npm install it as an external dependency. |
Oh, and here's an example patch in an open source project - Use jasmine.async lib to simplify async tests. by patkujawa-wf · Pull Request #23 · WebFilings/wf-common. |
I'd use bower install -D or npm install --save-dev because it is an On 22/09/2014 17:20, Pat Kujawa wrote:
|
Hi everyone - first off, sorry i didn't see this issue before! i've been buried under github notifications forever and am trying to dig out. FWIW, there's a nodejs specific package for this at https://github.com/derickbailey/node-jasmine-async - i realize it's a bad idea to have two separate repositories for this... i was in a rush when i put that second one together. i don't have a specific package for bower or anything else, though... cause honestly, i don't really use this package that much anymore. w/ Jasmine v2.x, this this functionality is built in. If anyone here would like to take over the jasmine.async project, please let me know. I'd be happy to give you access to the repository, or have it transfered to your account, so it can be properly managed. |
@leegee I realize that it is an external dep, but when all the necessary code is ~50 lines, it doesn't make sense to pull down the entire repo (as bower and npm will do unless given instructions otherwise). Honestly, just paste this into your app, adjust the module structure to what you need, and go from there :) // Jasmine.Async, v0.1.0
// Copyright (c)2012 Muted Solutions, LLC. All Rights Reserved.
// Distributed under MIT license
// http://github.com/derickbailey/jasmine.async
this.AsyncSpec = (function(global){
// Private Methods
// ---------------
function runAsync(block){
return function(){
var done = false;
var complete = function(){ done = true; };
runs(function(){
block(complete);
});
waitsFor(function(){
return done;
});
};
}
// Constructor Function
// --------------------
function AsyncSpec(spec){
this.spec = spec;
}
// Public API
// ----------
AsyncSpec.prototype.beforeEach = function(block){
this.spec.beforeEach(runAsync(block));
};
AsyncSpec.prototype.afterEach = function(block){
this.spec.afterEach(runAsync(block));
};
AsyncSpec.prototype.it = function(description, block){
// For some reason, `it` is not attached to the current
// test suite, so it has to be called from the global
// context.
global.it(description, runAsync(block));
};
return AsyncSpec;
})(this); |
:) Yeah, I know, but then I do that in 10 projects On 23/09/2014 21:21, Pat Kujawa wrote:
|
Hi,
I'm using Jasmine which is based on Protractor.
Could you please provide some instructions how to use the async package with described env.
currently I'm getting ReferenceError: AsyncSpec is not defined
Thanks
The text was updated successfully, but these errors were encountered: