Skip to content
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

Add a test to make sure runAsTask works in production #22

Open
phillipskevin opened this issue Nov 9, 2018 · 0 comments
Open

Add a test to make sure runAsTask works in production #22

phillipskevin opened this issue Nov 9, 2018 · 0 comments

Comments

@phillipskevin
Copy link
Contributor

The current test for runAsTask (

QUnit.test(".runAsTask(fn)", function(){
var lastTask;
var outerNotify, innerNotify;
var obj = {};
var thing = function(){
queues.enqueueByQueue({
"notify": [innerNotify = function notify () {
lastTask = queues.lastTask();
}],
"domUI": [function domUI () {
var stack = queues.stack(lastTask);
QUnit.equal(stack[0].fn, outerNotify);
QUnit.equal(stack[1].fn, thing);
QUnit.deepEqual(stack[1].args[0], 1);
QUnit.equal(stack[1].context, obj);
QUnit.equal(stack[2].fn, innerNotify);
}]
});
};
var thingQueued = queues.runAsTask(thing);
queues.enqueueByQueue({
"notify": [outerNotify = function notify () {
thingQueued.call(obj, 1);
}]
});
});
) is using lastTask so cannot be run in production. We should add another test to make sure runAsTask works in production.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants