How to use the @jupyterlab/docregistry.TextModelFactory function in @jupyterlab/docregistry

To help you get started, we’ve selected a few @jupyterlab/docregistry examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jupyterlab / jupyterlab / tests / test-docregistry / src / default.spec.ts View on Github external
it('should get the file type', () => {
        const factory = new TextModelFactory();
        expect(factory.contentType).to.equal('file');
      });
    });
github yuvipanda / simplest-notebook / test / src / docregistry / default.spec.ts View on Github external
it('should get the file type', () => {
        let factory = new TextModelFactory();
        expect(factory.contentType).to.be('file');
      });
github jupyterlab / jupyterlab / tests / test-docregistry / src / default.spec.ts View on Github external
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');
      });
    });
github jupyterlab / jupyterlab-data-explorer / tests / test-docregistry / src / default.spec.ts View on Github external
it('should accept a language preference', () => {
        const factory = new TextModelFactory();
        const model = factory.createNew('foo');
        expect(model.defaultKernelLanguage).to.equal('foo');
      });
    });
github yuvipanda / simplest-notebook / test / src / docregistry / default.spec.ts View on Github external
it('should be safe to call multiple times', () => {
        let factory = new TextModelFactory();
        factory.dispose();
        factory.dispose();
        expect(factory.isDisposed).to.be(true);
      });
github yuvipanda / simplest-notebook / test / src / docregistry / default.spec.ts View on Github external
it('should get the file format', () => {
        let factory = new TextModelFactory();
        expect(factory.fileFormat).to.be('text');
      });
github yuvipanda / simplest-notebook / test / src / docregistry / default.spec.ts View on Github external
it('should get the name of the model type', () => {
        let factory = new TextModelFactory();
        expect(factory.name).to.be('text');
      });
github jupyterlab / jupyterlab / tests / test-csvviewer / src / widget.spec.ts View on Github external
function createContext(): Context {
  const factory = new TextModelFactory();
  const manager = new ServiceManager({ standby: 'never' });
  const path = UUID.uuid4() + '.csv';
  return new Context({ factory, manager, path });
}
github jupyterlab / jupyterlab-data-explorer / tests / test-docmanager / src / widgetmanager.spec.ts View on Github external
describe('@jupyterlab/docmanager', () => {
  let manager: LoggingManager;
  let services: ServiceManager.IManager;
  const textModelFactory = new TextModelFactory();
  let context: Context;
  const widgetFactory = new WidgetFactory({
    name: 'test',
    fileTypes: ['text']
  });
  const readOnlyFactory = new WidgetFactory({
    name: 'readonly',
    fileTypes: ['text'],
    readOnly: true
  });

  before(() => {
    services = new ServiceManager({ standby: 'never' });
  });

  beforeEach(() => {
github jupyterlab / jupyterlab / test / src / filebrowser / buttons.spec.ts View on Github external
describe('filebrowser/buttons', () => {

  let services: ServiceManager.IManager;
  let manager: DocumentManager;
  let registry: DocumentRegistry;
  let commands: CommandRegistry;
  let model: FileBrowserModel;
  let buttons: FileButtons;
  let modelFactory = new TextModelFactory();
  let widgetFactory = new WidgetFactory({
    name: 'test',
    fileExtensions: ['.txt'],
    defaultFor: ['.txt']
  });
  let openedWidget: Widget;

  before((done) => {
    services = new ServiceManager();
    services.ready.then(done, done);
  });

  beforeEach(() => {
    openedWidget = null;
    commands = new CommandRegistry();
    registry = new DocumentRegistry();