Example #1
0
 it('should get the preferred kernel language given an extension', () => {
   const factory = new TextModelFactory();
   expect(factory.preferredLanguage('.py')).to.equal('python');
   expect(factory.preferredLanguage('.jl')).to.equal('julia');
 });
Example #2
0
 it('should accept a language preference', () => {
   const factory = new TextModelFactory();
   const model = factory.createNew('foo');
   expect(model.defaultKernelLanguage).to.equal('foo');
 });
Example #3
0
 it('should create a new model', () => {
   const factory = new TextModelFactory();
   const model = factory.createNew();
   expect(model).to.be.an.instanceof(DocumentModel);
 });
Example #4
0
 it('should be safe to call multiple times', () => {
   const factory = new TextModelFactory();
   factory.dispose();
   factory.dispose();
   expect(factory.isDisposed).to.equal(true);
 });
Example #5
0
 it('should dispose of the resources held by the factory', () => {
   const factory = new TextModelFactory();
   factory.dispose();
   expect(factory.isDisposed).to.equal(true);
 });
Example #6
0
 it('should get whether the factory is disposed', () => {
   const factory = new TextModelFactory();
   expect(factory.isDisposed).to.equal(false);
   factory.dispose();
   expect(factory.isDisposed).to.equal(true);
 });