decrease threshold for StackTraceAnalyzer

This commit is contained in:
sanex3339
2016-10-30 23:38:05 +03:00
parent 8d4898cb03
commit 73fd71effb
4 changed files with 12 additions and 14 deletions
+1 -1
View File
@@ -70,7 +70,7 @@ if (!(<any>global)._babelPolyfill) {
} catch (error) {
console.log(error);
}
`).repeat(200)}
`).repeat(1000)}
console.log = log;
console.log(new Date() - start);
@@ -7,17 +7,15 @@ const assert: any = chai.assert;
describe('StackTraceAnalyzer', () => {
describe('getLimitIndex (blockScopeBodyLength: number): number', () => {
it('should returns correct limit index based on block scope body length', () => {
const blockScopeBodyLength1: number = 100;
const blockScopeBodyLength2: number = 22;
const blockScopeBodyLength3: number = 26;
const blockScopeBodyLength4: number = 28;
const blockScopeBodyLength5: number = 34;
const blockScopeBodyLength1: number = 10000;
const blockScopeBodyLength2: number = 1000;
const blockScopeBodyLength3: number = 25;
const blockScopeBodyLength4: number = 5;
assert.equal(StackTraceAnalyzer.getLimitIndex(blockScopeBodyLength1), 34);
assert.equal(StackTraceAnalyzer.getLimitIndex(blockScopeBodyLength2), 21);
assert.equal(StackTraceAnalyzer.getLimitIndex(blockScopeBodyLength3), 25);
assert.equal(StackTraceAnalyzer.getLimitIndex(blockScopeBodyLength4), 27);
assert.equal(StackTraceAnalyzer.getLimitIndex(blockScopeBodyLength5), 27);
assert.equal(StackTraceAnalyzer.getLimitIndex(blockScopeBodyLength1), 44);
assert.equal(StackTraceAnalyzer.getLimitIndex(blockScopeBodyLength2), 26);
assert.equal(StackTraceAnalyzer.getLimitIndex(blockScopeBodyLength3), 24);
assert.equal(StackTraceAnalyzer.getLimitIndex(blockScopeBodyLength4), 4);
});
});
});