1
- import { SyncPromise } from '../src/syncpromise' ;
1
+ import { SyncPromise , syncPromiseResolve , syncPromiseReject } from '../src/syncpromise' ;
2
2
3
3
describe ( 'SyncPromise' , ( ) => {
4
4
test ( 'simple' , ( ) => {
@@ -17,9 +17,9 @@ describe('SyncPromise', () => {
17
17
return new SyncPromise < number > ( resolve => {
18
18
resolve ( 42 ) ;
19
19
} )
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 ) )
23
23
. then ( val => {
24
24
expect ( val ) . toBe ( false ) ;
25
25
} ) ;
@@ -84,7 +84,7 @@ describe('SyncPromise', () => {
84
84
return (
85
85
c
86
86
// @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 ) )
88
88
. then ( val => f ( b , val ) )
89
89
// @ts -ignore Argument of type 'SyncPromise<string>' is not assignable to parameter of type 'string'
90
90
. then ( val => f ( a , val ) )
@@ -97,7 +97,7 @@ describe('SyncPromise', () => {
97
97
test ( 'simple static' , ( ) => {
98
98
expect . assertions ( 1 ) ;
99
99
100
- const p = SyncPromise . resolve ( 10 ) ;
100
+ const p = syncPromiseResolve ( 10 ) ;
101
101
return p . then ( val => {
102
102
expect ( val ) . toBe ( 10 ) ;
103
103
} ) ;
@@ -260,7 +260,7 @@ describe('SyncPromise', () => {
260
260
} )
261
261
. then ( value => {
262
262
expect ( value ) . toEqual ( 2 ) ;
263
- return SyncPromise . reject ( 'wat' ) ;
263
+ return syncPromiseReject ( 'wat' ) ;
264
264
} )
265
265
. then ( null , reason => {
266
266
expect ( reason ) . toBe ( 'wat' ) ;
0 commit comments