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 allow addition of history items', async () => {
const history = new ConsoleHistory({ session });
const item = 'foo';
history.push(item);
const result = await history.back('');
expect(result).to.equal(item);
});
});
it('should be safe to dispose multiple times', () => {
const history = new ConsoleHistory({ session });
expect(history.isDisposed).to.equal(false);
history.dispose();
history.dispose();
expect(history.isDisposed).to.equal(true);
});
});
it('should return an empty string if no history exists', async () => {
const history = new ConsoleHistory({ session });
const result = await history.forward('');
expect(result).to.equal('');
});
it('should be the client session object', () => {
const history = new ConsoleHistory({ session });
expect(history.session).to.equal(session);
});
});
it('should create a console history object', () => {
const history = new ConsoleHistory({ session });
expect(history).to.be.an.instanceof(ConsoleHistory);
});
});
it('should return an empty string if no history exists', async () => {
const history = new ConsoleHistory({ session });
const result = await history.back('');
expect(result).to.equal('');
});