forked from bda-research/node-crawler
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated jQuery to 1.8.3, fix+test always absolute a.href
- Loading branch information
Showing
11 changed files
with
146 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<html> | ||
<body> | ||
<a href="links2.html">Relative link</a> | ||
|
||
<a href="/mockfiles/links2.html">Absolute link</a> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<html> | ||
<body> | ||
<a href="links1.html">Relative link</a> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
0 info it worked if it ends with ok | ||
1 verbose cli [ 'node', '/usr/local/bin/npm', 'test' ] | ||
2 info using [email protected] | ||
3 info using [email protected] | ||
4 verbose node symlink /usr/local/bin/node | ||
5 verbose config file /Users/sylvinus/.npmrc | ||
6 verbose config file /usr/local/etc/npmrc | ||
7 verbose config file /usr/local/lib/node_modules/npm/npmrc | ||
8 verbose read json /Users/sylvinus/w/sz/node-crawler/test/package.json | ||
9 error Error: ENOENT, open '/Users/sylvinus/w/sz/node-crawler/test/package.json' | ||
10 error If you need help, you may report this log at: | ||
10 error <http://github.com/isaacs/npm/issues> | ||
10 error or email it to: | ||
10 error <[email protected]> | ||
11 error System Darwin 12.2.0 | ||
12 error command "node" "/usr/local/bin/npm" "test" | ||
13 error cwd /Users/sylvinus/w/sz/node-crawler/test | ||
14 error node -v v0.8.4 | ||
15 error npm -v 1.1.45 | ||
16 error path /Users/sylvinus/w/sz/node-crawler/test/package.json | ||
17 error code ENOENT | ||
18 error errno 34 | ||
19 verbose exit [ 34, true ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
var Crawler = require("../../lib/crawler").Crawler; | ||
var _ = require("underscore"); | ||
|
||
QUnit.module("links"); | ||
|
||
var DEBUG = true; | ||
var MOCKPORT = 30045; | ||
|
||
|
||
test("links resolve to absolute urls", function() { | ||
expect( 2 ); | ||
|
||
stop(); | ||
|
||
var c = new Crawler({ | ||
"debug":DEBUG, | ||
"timeout":500, | ||
"retryTimeout":1000, | ||
"retries":1, | ||
"onDrain":function() { | ||
start(); | ||
} | ||
}); | ||
|
||
c.queue([{ | ||
"uri":"http://127.0.0.1:"+MOCKPORT+"/mockfiles/links1.html", | ||
"callback":function(error,result,$) { | ||
|
||
var links = _.map($("a"),function(a) { | ||
return a.href; | ||
}); | ||
|
||
//Both links should be resolve to absolute URLs | ||
equal(links[0],"http://127.0.0.1:30045/mockfiles/links2.html"); | ||
equal(links[1],"http://127.0.0.1:30045/mockfiles/links2.html"); | ||
|
||
} | ||
}]); | ||
|
||
|
||
}); |
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.