StackTraceAnalyzer.spec.ts 1.1 KB

1234567891011121314151617181920212223
  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 = 100;
  8. const blockScopeBodyLength2: number = 22;
  9. const blockScopeBodyLength3: number = 26;
  10. const blockScopeBodyLength4: number = 28;
  11. const blockScopeBodyLength5: number = 34;
  12. assert.equal(StackTraceAnalyzer.getLimitIndex(blockScopeBodyLength1), 34);
  13. assert.equal(StackTraceAnalyzer.getLimitIndex(blockScopeBodyLength2), 21);
  14. assert.equal(StackTraceAnalyzer.getLimitIndex(blockScopeBodyLength3), 25);
  15. assert.equal(StackTraceAnalyzer.getLimitIndex(blockScopeBodyLength4), 27);
  16. assert.equal(StackTraceAnalyzer.getLimitIndex(blockScopeBodyLength5), 27);
  17. });
  18. });
  19. });