Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
alvagi
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
alvagi
Commits
71085fbc
Commit
71085fbc
authored
Jan 10, 2015
by
sergey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add grunt coverage
add some tests
parent
a08fa21f
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
59 additions
and
1 deletion
+59
-1
.gitignore
.gitignore
+2
-0
Gruntfile.js
Gruntfile.js
+17
-0
package.json
package.json
+5
-1
index.js
test/index.js
+35
-0
No files found.
.gitignore
View file @
71085fbc
node_modules/
coverage
html-report
\ No newline at end of file
Gruntfile.js
0 → 100644
View file @
71085fbc
module
.
exports
=
function
(
grunt
){
grunt
.
initConfig
({
mocha_istanbul
:
{
coverage
:
{
src
:
'
test
'
,
options
:
{
'
ui
'
:
'
tdd
'
,
'
recursive
'
:
true
,
'
reporter
'
:
'
mocha-istanbul
'
}
}
}
});
grunt
.
loadNpmTasks
(
'
grunt-mocha-istanbul
'
);
grunt
.
registerTask
(
'
coverage
'
,
[
'
mocha_istanbul:coverage
'
]);
};
\ No newline at end of file
package.json
View file @
71085fbc
...
...
@@ -19,8 +19,12 @@
},
"devDependencies"
:
{
"
expect.js
"
:
"
*
"
,
"
grunt
"
:
"
^0.4.5
"
,
"
grunt-mocha-istanbul
"
:
"
^2.2.0
"
,
"
istanbul
"
:
"
^0.3.5
"
,
"
memorystream
"
:
"
^0.3.0
"
,
"
memstream
"
:
"
*
"
,
"
mocha
"
:
"
*
"
"
mocha
"
:
"
*
"
,
"
mocha-istanbul
"
:
"
^0.2.0
"
}
}
test/index.js
View file @
71085fbc
...
...
@@ -184,6 +184,34 @@ describe('Context', function() {
});
});
describe
(
'
say number
'
,
function
()
{
it
(
'
say number
'
,
function
()
{
this
.
context
.
sayNumber
(
'
1234
'
,
'
#
'
,
function
()
{});
expect
(
this
.
context
.
sent
.
join
(
''
)).
to
.
eql
(
'
SAY NUMBER 1234 "#"
\n
'
);
});
});
describe
(
'
say phonetic
'
,
function
()
{
it
(
'
say phonetic
'
,
function
()
{
this
.
context
.
sayPhonetic
(
'
1234ABCD
'
,
'
#
'
,
function
()
{});
expect
(
this
.
context
.
sent
.
join
(
''
)).
to
.
eql
(
'
SAY PHONETIC 1234ABCD "#"
\n
'
);
});
});
describe
(
'
context dial
'
,
function
()
{
it
(
'
context dial
'
,
function
()
{
this
.
context
.
dial
(
'
123
'
,
10
,
'
A
'
,
function
()
{});
expect
(
this
.
context
.
sent
.
join
(
''
)).
to
.
eql
(
'
EXEC Dial 123,10,A
\n
'
);
});
});
describe
(
'
say digits
'
,
function
()
{
it
(
'
say digits
'
,
function
()
{
this
.
context
.
sayDigits
(
'
1234
'
,
'
#
'
,
function
()
{});
expect
(
this
.
context
.
sent
.
join
(
''
)).
to
.
eql
(
'
SAY DIGITS 1234 "#"
\n
'
);
});
});
describe
(
'
waitForDigit
'
,
function
()
{
it
(
'
sends with default timeout
'
,
function
()
{
this
.
context
.
waitForDigit
(
function
()
{});
...
...
@@ -203,6 +231,13 @@ describe('Context', function() {
});
});
describe
(
'
answer
'
,
function
()
{
it
(
'
sends "ANSWER
\\
n"
'
,
function
()
{
this
.
context
.
answer
();
expect
(
this
.
context
.
sent
.
join
(
''
)).
to
.
eql
(
'
ANSWER
\n
'
);
});
});
describe
(
'
events
'
,
function
()
{
describe
(
'
error
'
,
function
()
{
it
(
'
is emitted when socket emits error
'
,
function
(
done
)
{
...
...
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