comparison lib-tests/spec/session.spec.ts @ 508:7ac80ad913c1

Setup a basic test harness for non-angular stuff. Fix accidental recursion in PersistentStack
author Lucas Thompson <dev@lucas.im>
date Mon, 27 Nov 2017 11:02:48 +0000
parents
children
comparison
equal deleted inserted replaced
507:0e6d4f994b73 508:7ac80ad913c1
1 import { PersistentStack } from '../../src/app/Session';
2 import * as jasmine from 'jasmine-core';
3
4 describe('PersistentStack', () => {
5 it('can add values to the front and maintain undo history', () => {
6 const stack = new PersistentStack<number>();
7 stack.unshift(1);
8 stack.unshift(2);
9 expect(stack.get(0)).toBe(2);
10 expect(stack.get(1)).toBe(1);
11 stack.stepBack();
12 expect(stack.get(0)).toBe(1);
13 expect(stack.get(1)).toBeUndefined();
14 });
15 });
16