Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should create a new editor', () => {
const factory = new CodeMirrorEditorFactory();
const editor = factory.newDocumentEditor({ host, model });
expect(editor).to.be.an.instanceof(CodeMirrorEditor);
editor.dispose();
});
it('should create a new editor with given options', () => {
const factory = new CodeMirrorEditorFactory(options);
const editor = factory.newDocumentEditor({
host,
model
}) as CodeMirrorEditor;
expect(editor).to.be.an.instanceof(CodeMirrorEditor);
for (let key in Object.keys(options)) {
const option = key as keyof CodeMirrorEditor.IConfig;
expect(editor.getOption(option)).to.equal(options[option]);
}
editor.dispose();
});
});
it('should create a new editor', () => {
const factory = new CodeMirrorEditorFactory();
const editor = factory.newInlineEditor({ host, model });
expect(editor).to.be.an.instanceof(CodeMirrorEditor);
editor.dispose();
});
it('should create a CodeMirrorEditorFactory', () => {
const factory = new CodeMirrorEditorFactory();
expect(factory).to.be.an.instanceof(CodeMirrorEditorFactory);
});
it('should create a new editor with given options', () => {
const factory = new CodeMirrorEditorFactory(options);
const editor = factory.newInlineEditor({
host,
model
}) as CodeMirrorEditor;
expect(editor).to.be.an.instanceof(CodeMirrorEditor);
for (let key in Object.keys(options)) {
const option = key as keyof CodeMirrorEditor.IConfig;
expect(editor.getOption(option)).to.equal(options[option]);
}
editor.dispose();
});
});