Skip to content

Commit

Permalink
0.3.4: express 3 support
Browse files Browse the repository at this point in the history
  • Loading branch information
sgentle committed Jun 5, 2012
1 parent a1c1dfc commit 3becc8f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "phantom",
"description": "PhantomJS wrapper for Node",
"homepage": "https://github.com/sgentle/phantomjs-node",
"version": "0.3.3",
"version": "0.3.4",
"repository": {
"type": "git",
"url": "git://github.com/sgentle/phantomjs-node.git"
Expand Down
8 changes: 4 additions & 4 deletions phantom.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,23 @@ module.exports =
app = express.createServer()
app.use express.static __dirname

app.listen()
appServer = app.listen()

server = dnode()

phantom = null

ps = startPhantomProcess app.address().port, args
ps = startPhantomProcess appServer.address().port, args

ps.on 'exit', (code) ->
app.close()
appServer.close()
phanta = (p for p in phanta when p isnt phantom)

io =
log: null,
'client store expiration': 0

server.listen app, {io}, (obj, conn) ->
server.listen appServer, {io}, (obj, conn) ->
phantom = conn.remote
wrap phantom
phanta.push phantom
Expand Down
6 changes: 3 additions & 3 deletions test/adv.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ app.get '/', (req, res) ->
</html>
"""

app.listen()
appServer = app.listen()

describe "The phantom module"
"Can create an instance with --load-images=no":
Expand All @@ -41,7 +41,7 @@ describe "The phantom module"
topic: t (p) ->
test = this
p.createPage (page) ->
page.open "http://127.0.0.1:#{app.address().port}/", (status) =>
page.open "http://127.0.0.1:#{appServer.address().port}/", (status) =>
setTimeout =>
test.callback null, page, status
, 1500
Expand All @@ -67,7 +67,7 @@ describe "The phantom module"


teardown: (p) ->
app.close()
appServer.close()
p.exit()


6 changes: 3 additions & 3 deletions test/page.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ app.get '/', (req, res) ->
</html>
"""

app.listen()
appServer = app.listen()

describe "Pages"
"A Phantom page":
Expand All @@ -46,7 +46,7 @@ describe "Pages"

"can open a URL on localhost":
topic: t (page) ->
page.open "http://127.0.0.1:#{app.address().port}/", (status) =>
page.open "http://127.0.0.1:#{appServer.address().port}/", (status) =>
@callback null, page, status

"and succeed": (err, page, status) ->
Expand Down Expand Up @@ -131,5 +131,5 @@ describe "Pages"
fs.unlink fileName

teardown: (page, ph) ->
app.close()
appServer.close()
ph.exit()

0 comments on commit 3becc8f

Please sign in to comment.