Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export async function main() {
log('Terminal');
// See if terminals are available
if (Terminal.isAvailable()) {
let manager = new TerminalManager();
// Create a named terminal session and send some data.
let session = await manager.startNew();
session.send({ type: 'stdin', content: ['foo'] });
}
}
it('should get the server settings', () => {
manager.dispose();
const serverSettings = ServerConnection.makeSettings();
const standby = 'never';
const token = serverSettings.token;
manager = new TerminalManager({ serverSettings, standby });
expect(manager.serverSettings.token).to.equal(token);
});
});
it('should get the server settings', () => {
manager.dispose();
const serverSettings = ServerConnection.makeSettings();
const standby = 'never';
const token = serverSettings.token;
manager = new TerminalManager({ serverSettings, standby });
expect(manager.serverSettings.token).to.equal(token);
});
});
it('should accept no options', () => {
manager.dispose();
manager = new TerminalManager({ standby: 'never' });
expect(manager).to.be.an.instanceof(TerminalManager);
});
it('should accept options', () => {
manager.dispose();
manager = new TerminalManager({
serverSettings: ServerConnection.makeSettings(),
standby: 'never'
});
expect(manager).to.be.an.instanceof(TerminalManager);
});
});
it('should test whether the manager is ready', async () => {
manager.dispose();
manager = new TerminalManager({ standby: 'never' });
expect(manager.isReady).to.equal(false);
await manager.ready;
expect(manager.isReady).to.equal(true);
});
});
it('should test whether the manager is ready', async () => {
manager.dispose();
manager = new TerminalManager({ standby: 'never' });
expect(manager.isReady).to.equal(false);
await manager.ready;
expect(manager.isReady).to.equal(true);
});
});
beforeEach(() => {
manager = new TerminalManager({ standby: 'never' });
return manager.ready;
});
beforeEach(() => {
manager = new TerminalManager({ standby: 'never' });
return manager.ready;
});
describe('Terminal', () => {
let widget: LogTerminal;
let session: TerminalNS.ITerminalConnection;
let manager = new TerminalManager();
before(async () => {
session = await manager.startNew();
});
beforeEach(() => {
widget = new LogTerminal(session);
Widget.attach(widget, document.body);
return framePromise();
});
afterEach(() => {
widget.dispose();
});
describe('#constructor()', () => {