-
Notifications
You must be signed in to change notification settings - Fork 7
/
util.js
36 lines (29 loc) · 859 Bytes
/
util.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/** Utility module */
"use strict";
module.exports={
// Next two methods taken from https://github.com/stjohnjohnson/cucumber-junit/blob/master/lib/cucumber_junit.js
/**
* Create property tag definiton
* @param {String} name property name
* @param {String|Number} value property value
* @return {Object} property
*/
createProperty:(name, value)=>{
return {
property: [
{
_attr: {
name: name,
value: value
}
}
]
};
},
/**
* Convert name to id. Just replace all spaces to '-' and translate to lowercase
* @param {String} obj
* @return {String} id from name
*/
convertNameToId:obj=>obj.replace(/\s/g, '-').toLowerCase()
};