StackTraceAnalyzer.spec.ts 955 B

123456789101112131415161718192021
  1. import * as chai from 'chai';
  2. import { StackTraceAnalyzer } from '../../../src/stack-trace-analyzer/StackTraceAnalyzer';
  3. const assert: any = chai.assert;
  4. describe('StackTraceAnalyzer', () => {
  5. describe('getLimitIndex (blockScopeBodyLength: number): number', () => {
  6. it('should returns correct limit index based on block scope body length', () => {
  7. const blockScopeBodyLength1: number = 10000;
  8. const blockScopeBodyLength2: number = 1000;
  9. const blockScopeBodyLength3: number = 25;
  10. const blockScopeBodyLength4: number = 5;
  11. assert.equal(StackTraceAnalyzer.getLimitIndex(blockScopeBodyLength1), 44);
  12. assert.equal(StackTraceAnalyzer.getLimitIndex(blockScopeBodyLength2), 26);
  13. assert.equal(StackTraceAnalyzer.getLimitIndex(blockScopeBodyLength3), 24);
  14. assert.equal(StackTraceAnalyzer.getLimitIndex(blockScopeBodyLength4), 4);
  15. });
  16. });
  17. });