Mercurial > hg > ugly-duckling
view lib-tests/spec/session.spec.ts @ 509:041468f553e1 tip master
Merge pull request #57 from LucasThompson/fix/session-stack-max-call-stack
Fix accidental recursion in PersistentStack
author | Lucas Thompson <LucasThompson@users.noreply.github.com> |
---|---|
date | Mon, 27 Nov 2017 11:04:30 +0000 |
parents | 7ac80ad913c1 |
children |
line wrap: on
line source
import { PersistentStack } from '../../src/app/Session'; import * as jasmine from 'jasmine-core'; describe('PersistentStack', () => { it('can add values to the front and maintain undo history', () => { const stack = new PersistentStack<number>(); stack.unshift(1); stack.unshift(2); expect(stack.get(0)).toBe(2); expect(stack.get(1)).toBe(1); stack.stepBack(); expect(stack.get(0)).toBe(1); expect(stack.get(1)).toBeUndefined(); }); });