Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
rsvp.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Romain Courteaud
rsvp.js
Commits
926895ac
Commit
926895ac
authored
Feb 25, 2020
by
Romain Courteaud
🐙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more queue tests
parent
77df9da7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
1 deletion
+61
-1
test/tests/extension_test.js
test/tests/extension_test.js
+61
-1
No files found.
test/tests/extension_test.js
View file @
926895ac
...
...
@@ -2416,6 +2416,8 @@ describe("`RSVP.Queue`", function () {
it
(
'
should `cancel` pending success `thenable`
'
,
function
(
done
)
{
var
thenable_cancel_called
=
false
,
thenable_ongoing
=
false
,
later_success_thenable_called
=
false
,
later_error_thenable_called
=
false
,
queue
=
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
new
Promise
(
...
...
@@ -2425,7 +2427,63 @@ describe("`RSVP.Queue`", function () {
function
()
{
thenable_cancel_called
=
true
;
});
}),
})
.
push
(
// Should be skipped
function
()
{
later_success_thenable_called
=
true
;},
function
()
{
later_error_thenable_called
=
true
;}
),
result
=
'
MARKER1
'
,
error
=
'
MARKER2
'
;
queue
.
then
(
function
(
e
)
{
result
=
e
;
});
queue
.
fail
(
function
(
e
)
{
error
=
e
;
});
setTimeout
(
function
()
{
assert
.
equal
(
queue
.
isRejected
,
undefined
);
assert
.
equal
(
queue
.
isFulfilled
,
undefined
);
assert
.
equal
(
thenable_ongoing
,
true
);
queue
.
cancel
();
assert
.
equal
(
thenable_cancel_called
,
true
);
setTimeout
(
function
()
{
assert
.
equal
(
queue
.
isRejected
,
true
);
assert
.
equal
(
queue
.
isFulfilled
,
undefined
);
assert
(
queue
.
rejectedReason
instanceof
RSVP
.
CancellationError
);
assert
.
equal
(
result
,
'
MARKER1
'
);
assert
(
error
instanceof
RSVP
.
CancellationError
);
assert
.
equal
(
later_success_thenable_called
,
false
);
assert
.
equal
(
later_error_thenable_called
,
false
);
done
();
},
20
);
},
20
);
});
it
(
'
should `cancel` pending error `thenable`
'
,
function
(
done
)
{
var
thenable_cancel_called
=
false
,
thenable_ongoing
=
false
,
later_success_thenable_called
=
false
,
later_error_thenable_called
=
false
,
queue
=
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
RSVP
.
reject
(
1
);
})
.
push
(
undefined
,
function
()
{
return
new
Promise
(
function
()
{
thenable_ongoing
=
true
;
},
function
()
{
thenable_cancel_called
=
true
;
});
})
.
push
(
// Should be skipped
function
()
{
later_success_thenable_called
=
true
;},
function
()
{
later_error_thenable_called
=
true
;}
),
result
=
'
MARKER1
'
,
error
=
'
MARKER2
'
;
queue
.
then
(
function
(
e
)
{
...
...
@@ -2447,6 +2505,8 @@ describe("`RSVP.Queue`", function () {
assert
(
queue
.
rejectedReason
instanceof
RSVP
.
CancellationError
);
assert
.
equal
(
result
,
'
MARKER1
'
);
assert
(
error
instanceof
RSVP
.
CancellationError
);
assert
.
equal
(
later_success_thenable_called
,
false
);
assert
.
equal
(
later_error_thenable_called
,
false
);
done
();
},
20
);
},
20
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment