BREAKING CHANGE(core): update
This commit is contained in:
		
							
								
								
									
										10
									
								
								test/test.ts
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								test/test.ts
									
									
									
									
									
								
							@@ -1,6 +1,6 @@
 | 
			
		||||
import { expect, tap } from '@pushrocks/tapbundle';
 | 
			
		||||
 | 
			
		||||
import * as smartdelay from '../ts/index';
 | 
			
		||||
import * as smartdelay from '../ts/index.js';
 | 
			
		||||
 | 
			
		||||
tap.test('.delayFor should delay async', async (tools) => {
 | 
			
		||||
  tools.timeout(5000);
 | 
			
		||||
@@ -10,7 +10,7 @@ tap.test('.delayFor should delay async', async (tools) => {
 | 
			
		||||
  }, 2000);
 | 
			
		||||
  await smartdelay.delayFor(3000).then(async () => {
 | 
			
		||||
    // tslint:disable-next-line:no-unused-expression
 | 
			
		||||
    expect(timePassed).to.be.true;
 | 
			
		||||
    expect(timePassed).toBeTrue();
 | 
			
		||||
  });
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
@@ -24,8 +24,8 @@ tap.test('.delayForRandom should delay async for a random time period', async (t
 | 
			
		||||
    timePassedAfter = true;
 | 
			
		||||
  }, 5000);
 | 
			
		||||
  await smartdelay.delayForRandom(3000, 4900);
 | 
			
		||||
  expect(timePassedBefore).to.be.true;
 | 
			
		||||
  expect(timePassedAfter).to.be.false;
 | 
			
		||||
  expect(timePassedBefore).toBeTrue();
 | 
			
		||||
  expect(timePassedAfter).toBeFalse();
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
tap.test('.delayFor should pass on a type', async (tools) => {
 | 
			
		||||
@@ -36,7 +36,7 @@ tap.test('.delayFor should pass on a type', async (tools) => {
 | 
			
		||||
  }, 2000);
 | 
			
		||||
  let hey = 'heyThere';
 | 
			
		||||
  await smartdelay.delayFor<string>(3000, hey).then(async (stringArg) => {
 | 
			
		||||
    expect(stringArg).equal('heyThere');
 | 
			
		||||
    expect(stringArg).toEqual('heyThere');
 | 
			
		||||
  });
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user