This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { CancellablePromise } from './cancellable-promise' | |
describe('CancellablePromise', () => { | |
describe('when cancelling', () => { | |
it( 'should reject with information of this', async () => { | |
const p: CancellablePromise<string> = new CancellablePromise(new Promise<string>(resolve => undefined)) | |
p.cancel() | |
await expect(p).rejects.toEqual({wasCancelled: true}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.enterprise.context.spi.CreationalContext; | |
import javax.enterprise.inject.spi.Bean; | |
import javax.enterprise.inject.spi.BeanManager; | |
import javax.naming.InitialContext; | |
import javax.naming.NamingException; | |
: | |
private static BeanManager getBeanManager() { | |
try { | |
InitialContext initialContext = new InitialContext(); | |
return (BeanManager) initialContext.lookup("java:comp/BeanManager"); |