File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 11describe ( 'promise' , function ( ) {
22 describe ( 'constructor' , function ( ) {
3- it ( 'shoud be resolve with 42.' , function ( done ) {
3+ it ( 'shoud be resolved with 42.' , function ( done ) {
44 var promise = new AV . Promise ( function ( resolve ) {
55 resolve ( 42 ) ;
66 } ) ;
@@ -11,6 +11,22 @@ describe('promise', function() {
1111 } ) ;
1212 } ) ;
1313
14+ describe ( 'as' , function ( ) {
15+ it ( 'should be resolved.' , function ( done ) {
16+ AV . Promise . as ( 42 ) . then ( function ( ret ) {
17+ expect ( ret ) . to . be ( 42 ) ;
18+ done ( ) ;
19+ } ) ;
20+ } ) ;
21+ it ( 'should be resolved when got a Promise.' , function ( done ) {
22+ AV . Promise . as ( Promise . resolve ( 42 ) ) . then ( function ( ret ) {
23+ expect ( ret ) . to . be ( 42 ) ;
24+ done ( ) ;
25+ } ) ;
26+ } ) ;
27+ } ) ;
28+
29+
1430 describe ( 'catch' , function ( ) {
1531 it ( 'shoud catch exception.' , function ( done ) {
1632 var promise = new AV . Promise ( function ( resolve ) {
You can’t perform that action at this time.
0 commit comments