1- import { SyncPromise } from '../src/syncpromise' ;
1+ import { SyncPromise , syncPromiseResolve , syncPromiseReject } from '../src/syncpromise' ;
22
33describe ( 'SyncPromise' , ( ) => {
44 test ( 'simple' , ( ) => {
@@ -17,9 +17,9 @@ describe('SyncPromise', () => {
1717 return new SyncPromise < number > ( resolve => {
1818 resolve ( 42 ) ;
1919 } )
20- . then ( _ => SyncPromise . resolve ( 'a' ) )
21- . then ( _ => SyncPromise . resolve ( 0.1 ) )
22- . then ( _ => SyncPromise . resolve ( false ) )
20+ . then ( _ => syncPromiseResolve ( 'a' ) )
21+ . then ( _ => syncPromiseResolve ( 0.1 ) )
22+ . then ( _ => syncPromiseResolve ( false ) )
2323 . then ( val => {
2424 expect ( val ) . toBe ( false ) ;
2525 } ) ;
@@ -84,7 +84,7 @@ describe('SyncPromise', () => {
8484 return (
8585 c
8686 // @ts -ignore Argument of type 'PromiseLike<string>' is not assignable to parameter of type 'SyncPromise<string>'
87- . then ( val => f ( SyncPromise . resolve ( 'x' ) , val ) )
87+ . then ( val => f ( syncPromiseResolve ( 'x' ) , val ) )
8888 . then ( val => f ( b , val ) )
8989 // @ts -ignore Argument of type 'SyncPromise<string>' is not assignable to parameter of type 'string'
9090 . then ( val => f ( a , val ) )
@@ -97,7 +97,7 @@ describe('SyncPromise', () => {
9797 test ( 'simple static' , ( ) => {
9898 expect . assertions ( 1 ) ;
9999
100- const p = SyncPromise . resolve ( 10 ) ;
100+ const p = syncPromiseResolve ( 10 ) ;
101101 return p . then ( val => {
102102 expect ( val ) . toBe ( 10 ) ;
103103 } ) ;
@@ -260,7 +260,7 @@ describe('SyncPromise', () => {
260260 } )
261261 . then ( value => {
262262 expect ( value ) . toEqual ( 2 ) ;
263- return SyncPromise . reject ( 'wat' ) ;
263+ return syncPromiseReject ( 'wat' ) ;
264264 } )
265265 . then ( null , reason => {
266266 expect ( reason ) . toBe ( 'wat' ) ;
0 commit comments