davidanson / check-pages Goto Github PK
View Code? Open in Web Editor NEWChecks various aspects of a web page for correctness.
License: MIT License
Checks various aspects of a web page for correctness.
License: MIT License
For example, a
should have href
or img
should have src
. See #4 for the motivating scenario.
I am running the default ‘checkDev’ task with gulp on a basic html template.
It picks up on some bad links e.g. that was an unresolved symbol:
Bad link (404): http://localhost:8080/_UNSUBLINK__ (17ms)
However some test dead links like http://www.deadlink-test.com were not picked up as inaccessible content in the console output which seemed odd.
Hosting the basic test template html and the stripped down gulp file here:
https://jsfiddle.net/hp4dkn7f/
Full test repository here:
https://github.com/fivedoor/frame-test-210716
Output:
Fivedoor-MacBook-Pro:frame-test fivedoor$ gulp checkDev
[15:12:40] Using gulpfile ~/Documents/development/frame-test/gulpfile.js
[15:12:41] Starting 'connect'...
[15:12:41] Finished 'connect' after 216 ms
[15:12:41] Starting 'watch'...
[15:12:41] Finished 'watch' after 34 ms
[15:12:41] Starting 'default'...
[15:12:41] Finished 'default' after 20 μs
[15:12:41] Starting 'checkDev'...
[15:12:45] Server started http://localhost:8080
[15:12:45] LiveReload started on port 35729
Checked 1 page and 2 links, found 24 issues.
Summary of issues:
http://localhost:8080
Unexpected close tag, Line: 12, Column: 7, Char: >
Unexpected close tag, Line: 12, Column: 7, Char: >
Unexpected close tag, Line: 12, Column: 7, Char: >
Unexpected close tag, Line: 49, Column: 49, Char: >
Unexpected close tag, Line: 49, Column: 49, Char: >
Unexpected close tag, Line: 49, Column: 49, Char: >
Unexpected close tag, Line: 49, Column: 49, Char: >
Unexpected close tag, Line: 49, Column: 49, Char: >
Unexpected close tag, Line: 49, Column: 49, Char: >
Unexpected close tag, Line: 49, Column: 49, Char: >
Unexpected close tag, Line: 49, Column: 49, Char: >
Unexpected close tag, Line: 49, Column: 49, Char: >
Unexpected close tag, Line: 49, Column: 49, Char: >
Unexpected close tag, Line: 49, Column: 49, Char: >
Unexpected close tag, Line: 49, Column: 49, Char: >
Unexpected close tag, Line: 49, Column: 49, Char: >
Unexpected close tag, Line: 49, Column: 49, Char: >
Unexpected close tag, Line: 49, Column: 49, Char: >
Unexpected close tag, Line: 49, Column: 49, Char: >
Missing Content-Encoding header in response
http://localhost:8080/
Local link: http://localhost:8080/_UNSUBLINK__
Bad link (404): http://localhost:8080/_UNSUBLINK__ (23ms)
Local link: http://localhost:8080/_badlink__
Bad link (404): http://localhost:8080/_badlink__ (9ms)
[15:12:45] 'checkDev' errored after 4.15 s
[15:12:45] Error: 24 issues.
at /Users/fivedoor/Documents/development/frame-test/node_modules/check-pages/checkPages.js:426:13
at next (/Users/fivedoor/Documents/development/frame-test/node_modules/check-pages/checkPages.js:435:5)
at Request.<anonymous> (/Users/fivedoor/Documents/development/frame-test/node_modules/check-pages/checkPages.js:192:11)
at emitOne (events.js:82:20)
at Request.emit (events.js:169:7)
at IncomingMessage.<anonymous> (/Users/fivedoor/Documents/development/frame-test/node_modules/check-pages/node_modules/request/request.js:988:12)
at emitNone (events.js:72:20)
at IncomingMessage.emit (events.js:166:7)
at endReadableNT (_stream_readable.js:913:12)
at nextTickCallbackWith2Args (node.js:442:9)
Version details:
• check-pages [ 0.10.0 ]
• Node [ v4.4.3 ]
• Npm [ 3.8.9 ]
• OS X 10.11.4
• Gulp 3.9.1
Thanks
Hey,
it generally works, but I get this error, any idea why?
[13:25:48] Error: 57 issues.
at /Users/lukasoppermann/Code/formandsystem-cms/node_modules/check-pages/checkPages.js:426:13
at next (/Users/lukasoppermann/Code/formandsystem-cms/node_modules/check-pages/checkPages.js:435:5)
at /Users/lukasoppermann/Code/formandsystem-cms/node_modules/check-pages/checkPages.js:119:18
at next (/Users/lukasoppermann/Code/formandsystem-cms/node_modules/check-pages/checkPages.js:435:5)
at /Users/lukasoppermann/Code/formandsystem-cms/node_modules/check-pages/checkPages.js:119:18
at next (/Users/lukasoppermann/Code/formandsystem-cms/node_modules/check-pages/checkPages.js:435:5)
at /Users/lukasoppermann/Code/formandsystem-cms/node_modules/check-pages/checkPages.js:119:18
at next (/Users/lukasoppermann/Code/formandsystem-cms/node_modules/check-pages/checkPages.js:435:5)
at Request._callback (/Users/lukasoppermann/Code/formandsystem-cms/node_modules/check-pages/checkPages.js:314:9)
at Request.self.callback (/Users/lukasoppermann/Code/formandsystem-cms/node_modules/request/request.js:200:22)
Basically the following fails:
<a href="#"></a>
but the following passes:
<a></a>
also ,
<a href=""></a>
why ?
If the support for the above 2 are also added , it would be of great help , as currently i have a requirement of testing for all 3 scenarios above.
Thank you.
Anytime I try to pass any urls like the following:
index.html
examples/*.html
I get an error saying invalid URL. However, if I point to a producation website, the module works correctly.
It would be nice, if check-pages will check, if correct URI fragment exists.
For example, I have correct URL "http://localhost:4147/path/to#KiraGod"
:
<a id="KiraGod"></a>
On another page, I make an incorrect link to the fragment identifier, example:
<a href="../path/to#KiraGo">KiraGod</a>
File to.html
has an anchor #KiraGod
, but not #KiraGo
; I make a typo.
It would be nice, if check-pages will check similar typos.
Me or maintainers of third-party sites can:
And site visitors may navigate to incorrect anchors.
For me this is a common problem, but I haven’t found any tools that can solve it. Examples:
Thanks.
In my opinion attribute srcset
would be great to be supported. I tried to provide a complete pull request introducing srcset
-checks for elements img
and source
, however, I wasn't able to integrate this functionality to your tests. To be specific, tests checkLinksQueryHashes
and localContentQueryHashesLinksToIgnore
failed on files containing the new attribute tags.
Package srcset already parses the attributes content reliable, which should be a good choice to build upon.
Hi there,
Apologies if I'm stumbling over something obvious which I haven’t figured out from my end but I keep encountering the following error when trying to run checDev with gulp
[21:58:19] Starting 'checkDev'...
Checked 1 page and 0 links, found 1 issue.
Summary of issues:
http://localhost:3000
Page error (connect ECONNREFUSED 127.0.0.1:3000): http://localhost:3000 (24ms)
[21:58:20] 'checkDev' errored after 1.24 s
[21:58:20] Error: 1 issue.
at /Users/fivedoor/Documents/development/fivedoor-email-frame/node_modules/check-pages/checkPages.js:426:13
at next (/Users/fivedoor/Documents/development/fivedoor-email-frame/node_modules/check-pages/checkPages.js:435:5)
at Request._callback (/Users/fivedoor/Documents/development/fivedoor-email-frame/node_modules/check-pages/checkPages.js:314:9)
at self.callback (/Users/fivedoor/Documents/development/fivedoor-email-frame/node_modules/check-pages/node_modules/request/request.js:200:22)
at emitOne (events.js:77:13)
at Request.emit (events.js:169:7)
at Request.onRequestError (/Users/fivedoor/Documents/development/fivedoor-email-frame/node_modules/check-pages/node_modules/request/request.js:831:8)
at emitOne (events.js:77:13)
at ClientRequest.emit (events.js:169:7)
at Socket.socketErrorListener (_http_client.js:256:9)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
at emitErrorNT (net.js:1253:8)
at nextTickCallbackWith2Args (node.js:442:9)
at process._tickCallback (node.js:356:17)
I gather from a little googling that it may be a proxy issues but I’m not sure how to resolve it and if it’s a check-pages issue or something else my end (though not had any other issue using localhost: 3000 with any other tasks in my chain.
Any advice on what the issue is / what to try / a solution greatly appreciated
Running the following:
gulp": ^3.9.1
check-pages": ^0.10.0
MACOS 10.11.4
Using the same settings as the Usage example gulp task except with localhost:3000
Thanks
Hey,
I really like this package. However, it would be nice if you could have a better reporting, my idea:
[09:46:05] 'checkLinks' errored after 701 ms
[09:46:05] Error: 56 issues.
at /Users/lukasoppermann/Code/veare/node_modules/check-pages/checkPages.js:426:13
at next (/Users/lukasoppermann/Code/veare/node_modules/check-pages/checkPages.js:435:5)
at Request.<anonymous> (/Users/lukasoppermann/Code/veare/node_modules/check-pages/checkPages.js:152:11)
at emitOne (events.js:96:13)
at Request.emit (events.js:191:7)
at Request.onRequestError (/Users/lukasoppermann/Code/veare/node_modules/request/request.js:884:8)
at emitOne (events.js:96:13)
at ClientRequest.emit (events.js:191:7)
at TLSSocket.socketErrorListener (_http_client.js:358:9)
at emitOne (events.js:96:13)
In case this is NOT an error in my code, I would think this should not be shown. Does this show up because the package found code errors?
❌ http://localhost:8080/portfolio
Missing Content-Encoding header in response
✅ http://localhost:8080/contact
Currently it is a little hard to get an easy overview of which pages need work and which are fine.
Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.