Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// If the message was not injected but otherwise would have been, emit
// a rejected signal. This should only happen if `enabled` is `false`.
const session = (msg.parent_header as KernelMessage.IHeader).session;
const msgType = msg.header.msg_type;
if (
session !== this.session.kernel.clientId &&
relevantTypes.has(msgType)
) {
this.rejected.emit(msg);
}
}
return injected;
}
}
const rendermime = defaultRenderMime();
const relevantTypes = [
'execute_input',
'execute_result',
'display_data',
'stream',
'error',
'clear_output'
].reduce((acc, val) => {
acc.add(val);
return acc;
}, new Set());
describe('@jupyterlab/console', () => {
describe('ForeignHandler', () => {
let local: Session.ISession;
// If the message was not injected but otherwise would have been, emit
// a rejected signal. This should only happen if `enabled` is `false`.
const session = (msg.parent_header as KernelMessage.IHeader).session;
const msgType = msg.header.msg_type;
if (
session !== this.session.kernel.clientId &&
relevantTypes.has(msgType)
) {
this.rejected.emit(msg);
}
}
return injected;
}
}
const rendermime = defaultRenderMime();
const relevantTypes = [
'execute_input',
'execute_result',
'display_data',
'stream',
'error',
'clear_output'
].reduce((acc, val) => {
acc.add(val);
return acc;
}, new Set());
describe('@jupyterlab/console', () => {
describe('ForeignHandler', () => {
let local: Session.ISession;
import {
IOutputAreaModel,
OutputAreaModel,
OutputArea
} from '@jupyterlab/outputarea';
import {
createClientSession,
defaultRenderMime,
NBTestUtils
} from '@jupyterlab/testutils';
/**
* The default rendermime instance to use for testing.
*/
const rendermime = defaultRenderMime();
const CODE = 'print("hello")';
class LogOutputArea extends OutputArea {
methods: string[] = [];
protected onUpdateRequest(msg: Message): void {
super.onUpdateRequest(msg);
this.methods.push('onUpdateRequest');
}
protected onModelChanged(
sender: IOutputAreaModel,
args: IOutputAreaModel.ChangedArgs
) {
super.onModelChanged(sender, args);
import {
IOutputAreaModel,
OutputAreaModel,
OutputArea
} from '@jupyterlab/outputarea';
import {
createClientSession,
defaultRenderMime,
NBTestUtils
} from '@jupyterlab/testutils';
/**
* The default rendermime instance to use for testing.
*/
const rendermime = defaultRenderMime();
const CODE = 'print("hello")';
class LogOutputArea extends OutputArea {
methods: string[] = [];
protected onUpdateRequest(msg: Message): void {
super.onUpdateRequest(msg);
this.methods.push('onUpdateRequest');
}
protected onModelChanged(
sender: IOutputAreaModel,
args: IOutputAreaModel.ChangedArgs
) {
super.onModelChanged(sender, args);
DocumentRegistry,
Context,
MimeContent,
MimeDocument,
MimeDocumentFactory
} from '@jupyterlab/docregistry';
import { RenderedText, IRenderMime } from '@jupyterlab/rendermime';
import {
createFileContext,
defaultRenderMime,
testEmission
} from '@jupyterlab/testutils';
const RENDERMIME = defaultRenderMime();
class LogRenderer extends MimeContent {
methods: string[] = [];
protected onAfterAttach(msg: Message): void {
super.onAfterAttach(msg);
this.methods.push('onAfterAttach');
}
protected onUpdateRequest(msg: Message): void {
super.onUpdateRequest(msg);
this.methods.push('onUpdateRequest');
}
}
class FooText extends RenderedText {
DocumentRegistry,
Context,
MimeContent,
MimeDocument,
MimeDocumentFactory
} from '@jupyterlab/docregistry';
import { RenderedText, IRenderMime } from '@jupyterlab/rendermime';
import {
createFileContext,
defaultRenderMime,
testEmission
} from '@jupyterlab/testutils';
const RENDERMIME = defaultRenderMime();
class LogRenderer extends MimeContent {
methods: string[] = [];
protected onAfterAttach(msg: Message): void {
super.onAfterAttach(msg);
this.methods.push('onAfterAttach');
}
protected onUpdateRequest(msg: Message): void {
super.onUpdateRequest(msg);
this.methods.push('onUpdateRequest');
}
}
class FooText extends RenderedText {