Created
August 31, 2016 21:47
-
-
Save marcysutton/c221a5b855bccbfd32bc7442738e3d49 to your computer and use it in GitHub Desktop.
JSDOM test
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
var jsdom = require('jsdom'); | |
// Some html page | |
var html = [ | |
'<html>', | |
'<body>', | |
'<p>An image without an alt tag! <img src="some.jpg" /></p>', | |
'<h2>Not an h1</h2>', | |
'<h5>blabla</h5>', | |
'<h4></h4>', | |
'</body>', | |
'</html>' | |
].join('\n'); | |
jsdom.env(html, function(err, window) { | |
global.window = window; | |
global.Node = window.Node; | |
global.NodeList = window.NodeList; | |
var axe = require('./axe.js'); | |
// var config = { | |
// rules: { | |
// 'color-contrast': {enabled: false} | |
// } | |
// } | |
var config = {}; | |
// Run the checks | |
axe.a11yCheck(window.document, config, function(data) { | |
console.log(data); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment