UNPKG

yhtml5-test

Version:

A test framework for front-end projects

26 lines (21 loc) 822 B
/** * Copyright (c) 2015-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ import { StackFrame } from '../utils/stack-frame'; test('proper empty shape', function () { var empty = new StackFrame(); expect(empty).toMatchSnapshot(); expect(empty.getFunctionName()).toBe('(anonymous function)'); expect(empty.getSource()).toBe(''); expect(empty.toString()).toBe('(anonymous function)'); }); test('proper full shape', function () { var empty = new StackFrame('a', 'b.js', 13, 37, undefined, 'apple', 'test.js', 37, 13); expect(empty).toMatchSnapshot(); expect(empty.getFunctionName()).toBe('a'); expect(empty.getSource()).toBe('b.js:13:37'); expect(empty.toString()).toBe('a (b.js:13:37)'); });