Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
jio_mebibou
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Alexandra Rogova
jio_mebibou
Commits
8221432f
Commit
8221432f
authored
Mar 10, 2015
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Drop unused code.
parent
315da2d6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
110 deletions
+0
-110
test/jio/util.js
test/jio/util.js
+0
-110
No files found.
test/jio/util.js
View file @
8221432f
...
@@ -20,28 +20,6 @@
...
@@ -20,28 +20,6 @@
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// Tools
// Tools
/**
* Creates a QUnit.start wrapper that allows to trigger start several times.
*
* @param {Number} num Timeout in ms
* @return {Function} The wrapper
*/
function
starter
(
num
)
{
var
started
=
false
,
ident
;
function
startFn
()
{
if
(
!
started
)
{
started
=
true
;
clearTimeout
(
ident
);
start
();
}
}
if
(
num
)
{
ident
=
setTimeout
(
startFn
,
num
);
}
return
startFn
;
}
exports
.
starter
=
starter
;
/**
/**
* Test if the string is an Uuid
* Test if the string is an Uuid
*
*
...
@@ -60,92 +38,4 @@
...
@@ -60,92 +38,4 @@
}
}
exports
.
isUuid
=
isUuid
;
exports
.
isUuid
=
isUuid
;
/**
* A useful tool to set/get json object into the localStorage
*/
exports
.
json_local_storage
=
{
clear
:
function
()
{
return
localStorage
.
clear
();
},
getItem
:
function
(
item
)
{
var
value
=
localStorage
.
getItem
(
item
);
return
value
===
null
?
null
:
JSON
.
parse
(
value
);
},
setItem
:
function
(
item
,
value
)
{
return
localStorage
.
setItem
(
item
,
JSON
.
stringify
(
value
));
},
removeItem
:
function
(
item
)
{
return
localStorage
.
removeItem
(
item
);
}
};
//////////////////////////////////////////////////////////////////////////////
// Deprecated
function
spyJioCallback
(
result_type
,
value
,
message
)
{
return
function
(
err
,
response
)
{
var
val
;
switch
(
result_type
)
{
case
'
value
'
:
val
=
err
||
response
;
break
;
case
'
status
'
:
val
=
(
err
||
{}).
status
;
break
;
case
'
jobstatus
'
:
val
=
(
err
?
'
fail
'
:
'
done
'
);
break
;
default
:
ok
(
false
,
"
Unknown case
"
+
result_type
);
break
;
}
deepEqual
(
val
,
value
,
message
);
};
}
exports
.
spyJioCallback
=
spyJioCallback
;
function
ospy
(
o
,
result_type
,
value
,
message
,
function_name
)
{
function_name
=
function_name
||
'
f
'
;
o
[
function_name
]
=
function
(
err
,
response
)
{
var
val
;
switch
(
result_type
)
{
case
'
value
'
:
val
=
err
||
response
;
break
;
case
'
status
'
:
val
=
(
err
||
{}).
status
;
break
;
case
'
jobstatus
'
:
val
=
(
err
?
'
fail
'
:
'
done
'
);
break
;
default
:
ok
(
false
,
"
Unknown case
"
+
result_type
);
break
;
}
deepEqual
(
val
,
value
,
message
);
};
sinon
.
spy
(
o
,
function_name
);
}
exports
.
ospy
=
ospy
;
function
otick
(
o
,
a
,
b
)
{
var
tick
=
1
,
function_name
=
'
f
'
;
if
(
typeof
a
===
'
number
'
&&
!
isNaN
(
a
))
{
tick
=
a
;
a
=
b
;
}
if
(
typeof
a
===
'
string
'
)
{
function_name
=
a
;
}
o
.
clock
.
tick
(
tick
);
if
(
!
o
[
function_name
].
calledOnce
)
{
if
(
o
[
function_name
].
called
)
{
ok
(
false
,
'
too much results
'
);
}
else
{
ok
(
false
,
'
no response
'
);
}
}
}
exports
.
otick
=
otick
;
}));
}));
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment