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
d859b7d1
Commit
d859b7d1
authored
Jun 10, 2015
by
antirek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix tests
parent
d28556a7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
index.js
lib/index.js
+1
-1
index.js
test/index.js
+6
-6
No files found.
lib/index.js
View file @
d859b7d1
...
...
@@ -10,7 +10,7 @@ var agi = function (handler) {
};
var
start
=
function
(
port
)
{
server
=
require
(
'
net
'
).
createServer
(
handle
).
listen
(
port
);
return
require
(
'
net
'
).
createServer
(
handle
).
listen
(
port
);
};
return
{
...
...
test/index.js
View file @
d859b7d1
var
MemoryStream
=
require
(
'
memorystream
'
);
var
agi
=
require
(
'
./../lib
'
)
var
expect
=
require
(
'
expect.js
'
);
var
Context
=
agi
.
Context
;
var
state
=
agi
.
state
;
var
Context
=
require
(
'
./../lib/context
'
)
;
var
state
=
require
(
'
./../lib/state
'
)
;
//helpers
var
writeVars
=
function
(
stream
)
{
...
...
@@ -503,15 +503,15 @@ describe('Context', function() {
describe
(
'
agi#createServer
'
,
function
()
{
it
(
'
returns instance of net.Server
'
,
function
()
{
var
net
=
require
(
'
net
'
);
var
server
=
agi
.
createServer
(
);
var
server
=
(
new
agi
()).
start
(
3000
);
expect
(
server
instanceof
net
.
Server
).
ok
();
});
it
(
'
invokes callback when a new connection is established
'
,
function
(
done
)
{
var
server
=
agi
.
createServer
(
function
(
context
)
{
expect
(
context
instanceof
agi
.
Context
);
var
server
=
new
agi
(
function
(
context
)
{
expect
(
context
instanceof
Context
);
done
();
});
})
.
start
(
3000
)
;
server
.
emit
(
'
connection
'
,
new
MemoryStream
());
});
...
...
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