diff options
author | Alex Shatov <alexs@att.com> | 2018-04-06 12:41:29 -0400 |
---|---|---|
committer | Alex Shatov <alexs@att.com> | 2018-04-06 12:41:29 -0400 |
commit | f8cab3eebdcee288332e16bda5bd6b2fa17e02ac (patch) | |
tree | fd7d6064ad9f712a982f413d36a30c6f779460af /tests/mock_utils.js | |
parent | 1c2fb197d1b406a6764dde9dddd14caa8c50713a (diff) |
4.4.1 deployment-handler -unit tests 84% coverage
- more logging on metrics - log both req and res
- unit tests of policy-update API
- log timing and messaging in unit tests
- code coverage
84.28% Statements 938/1113
65.51% Branches 321/490
81.58% Functions 155/190
84.34% Lines 926/1098
Change-Id: I3587135ceac76b291f83753441421a917a8b8bdf
Signed-off-by: Alex Shatov <alexs@att.com>
Issue-ID: DCAEGEN2-258
Diffstat (limited to 'tests/mock_utils.js')
-rw-r--r-- | tests/mock_utils.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/mock_utils.js b/tests/mock_utils.js index 2d7d2e5..311e9dc 100644 --- a/tests/mock_utils.js +++ b/tests/mock_utils.js @@ -23,3 +23,14 @@ module.exports.sleep = function(time) { resolve(); }, time)); }; + +module.exports.ActionTimer = class ActionTimer { + constructor() { + this.started = Date.now(); + } + get step() { + let num = Date.now() - this.started; + return ("000000" + num).slice(-Math.max(5, (""+num).length)); + } +}; + |