Extend tests to fully cover invocation concerns

Update test metadata to accurately describe the more complete set of
assertions.
This commit is contained in:
Mike Pennisi 2015-12-28 17:25:24 -05:00
parent 5f2ba2522f
commit eded6b269b
4 changed files with 36 additions and 12 deletions

View File

@ -3,10 +3,12 @@
/*---
info: >
Promise reaction jobs have predictable environment
[...]
6. Else, let handlerResult be Call(handler, undefined, «argument»).
es6id: S25.4.2.1_A3.1_T1
author: Sam Mikes
description: Promise.onFulfilled gets undefined as 'this'
description: >
"fulfilled" handler invoked correctly outside of strict mode
flags: [noStrict]
includes: [fnGlobalObject.js]
---*/
@ -25,6 +27,11 @@ var p = Promise.resolve(obj).then(function(arg) {
return;
}
if (arguments.length !== 1) {
$DONE('Expected handler function to be called with exactly 1 argument.');
return;
}
$DONE();
}, function() {
$DONE('The promise should not be rejected.');

View File

@ -3,10 +3,12 @@
/*---
info: >
Promise reaction jobs have predictable environment
[...]
6. Else, let handlerResult be Call(handler, undefined, «argument»).
es6id: S25.4.2.1_A3.1_T2
author: Sam Mikes
description: Promise.onFulfilled gets undefined as 'this'
description: >
"fulfilled" handler invoked correctly in strict mode
flags: [onlyStrict]
---*/
@ -24,6 +26,11 @@ var p = Promise.resolve(obj).then(function(arg) {
return;
}
if (arguments.length !== 1) {
$DONE('Expected handler function to be called with exactly 1 argument.');
return;
}
$DONE();
}, function() {
$DONE('The promise should not be rejected.');

View File

@ -3,12 +3,12 @@
/*---
info: >
Promise reaction jobs have predictable environment
'this' is global object in sloppy mode,
undefined in strict mode
[...]
6. Else, let handlerResult be Call(handler, undefined, «argument»).
es6id: S25.4.2.1_A3.2_T1
author: Sam Mikes
description: onRejected gets default 'this'
description: >
"rejected" handler invoked correctly outside of strict mode
flags: [noStrict]
includes: [fnGlobalObject.js]
---*/
@ -29,5 +29,10 @@ var p = Promise.reject(obj).then(function () {
return;
}
if (arguments.length !== 1) {
$DONE('Expected handler function to be called with exactly 1 argument.');
return;
}
$DONE();
});

View File

@ -3,12 +3,12 @@
/*---
info: >
Promise reaction jobs have predictable environment
'this' is global object in sloppy mode,
undefined in strict mode
[...]
6. Else, let handlerResult be Call(handler, undefined, «argument»).
es6id: S25.4.2.1_A3.2_T2
author: Sam Mikes
description: onRejected gets default 'this'
description: >
"rejected" handler invoked correctly in strict mode
flags: [onlyStrict]
---*/
@ -28,5 +28,10 @@ var p = Promise.reject(obj).then(function () {
return;
}
if (arguments.length !== 1) {
$DONE('Expected handler function to be called with exactly 1 argument.');
return;
}
$DONE();
});