Exemple #1
0
 it('should be emitted when the context is disposed', (done) => {
   context.disposed.connect((sender, args) => {
     expect(sender).to.be(context);
     expect(args).to.be(void 0);
     done();
   });
   context.dispose();
 });
Exemple #2
0
 it('should be emitted when the context is disposed', () => {
   let called = false;
   context.disposed.connect((sender, args) => {
     expect(sender).to.equal(context);
     expect(args).to.be.undefined;
     called = true;
   });
   context.dispose();
   expect(called).to.equal(true);
 });
Exemple #3
0
 return context.session.shutdown().then(() => {
   context.dispose();
 });
Exemple #4
0
 it('should dispose of the resources used by the context', () => {
   context.dispose();
   expect(context.isDisposed).to.be(true);
   context.dispose();
   expect(context.isDisposed).to.be(true);
 });
Exemple #5
0
 it('should test whether the context is disposed', () => {
   expect(context.isDisposed).to.be(false);
   context.dispose();
   expect(context.isDisposed).to.be(true);
 });
 it('should be true after the context is disposed', () => {
   context.dispose();
   expect(handler.isDisposed).to.equal(true);
 });
 afterEach(() => {
   context.dispose();
   handler.dispose();
 });
 afterEach(async () => {
   await context.session.shutdown();
   context.dispose();
 });
 afterEach(() => {
   context.dispose();
 });