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 be called upon an editor edge request', async () => {
const history = new TestHistory({ session });
expect(history.methods).to.not.contain('onEdgeRequest');
const host = document.createElement('div');
const model = new CodeEditor.Model();
const editor = new CodeMirrorEditor({ model, host });
history.editor = editor;
history.push('foo');
const promise = signalToPromise(editor.model.value.changed);
editor.edgeRequested.emit('top');
expect(history.methods).to.contain('onEdgeRequest');
await promise;
expect(editor.model.value.text).to.equal('foo');
});
});
it('should be called upon an editor text change', () => {
const history = new TestHistory({ session });
expect(history.methods).to.not.contain('onTextChange');
const model = new CodeEditor.Model();
const host = document.createElement('div');
const editor = new CodeMirrorEditor({ model, host });
history.editor = editor;
model.value.text = 'foo';
expect(history.methods).to.contain('onTextChange');
});
});
const factory = (options: CodeEditor.IOptions) => {
return new CodeMirrorEditor(options);
};
return new CodeEditorWrapper({ factory, model });
let factory = (options: CodeEditor.IOptions) => {
return new CodeMirrorEditor(options);
};
return new CodeEditorWrapper({ factory, model });
let factory = (options: CodeEditor.IOptions) => {
return new CodeMirrorEditor(options);
};
return new CodeEditorWrapper({ factory, model });
let factory = (options: CodeEditor.IOptions) => {
return new CodeMirrorEditor(options);
};
return new CodeEditorWrapper({ factory, model });
const factory = (options: CodeEditor.IOptions) => {
return new CodeMirrorEditor(options);
};
return new CodeEditorWrapper({ factory, model });