Created
June 27, 2012 14:54
-
-
Save sebs/3004612 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
< HTTP/1.1 200 OK | |
< 0: t | |
< 1: e | |
< 2: x | |
< 3: t | |
< 4: / | |
< 5: c | |
< 6: s | |
< 7: s | |
< Content-Type: text/css; charset=utf-8 | |
< ETag: e4dcc5c5c8c57a12fa7c60a70422da47c921c631 | |
< Connection: keep-alive | |
< Transfer-Encoding: chunked |
This file contains hidden or 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 config = module.exports; | |
var fs = require("fs"); | |
config["dk tests"] = { | |
rootPath: "../", | |
environment: "browser", // or "node" | |
sources: [ | |
'js/external/jquery-1.7.2.min.js', | |
'js/lib/source.js', | |
'js/lib/upload.js', | |
'js/lib/scanForBg.js', | |
'js/lib/validate.js' | |
], | |
tests: [ | |
"test/scanforbg-test.js" | |
], | |
resources: [ | |
{path: "simple", file: 'test/fixtures/simple.html', headers: "text/html"}, | |
{path: "style.css", file: 'test/fixtures/style.css', headers: "text/css"}, | |
] | |
} |
This file contains hidden or 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
<html> | |
<head> | |
<script type="text/javascript"></script> | |
<link id="styletest" type="text/css" rel="stylesheet" media="all" href="style.css" /> | |
</head> | |
<body> | |
</body> | |
</html> |
This file contains hidden or 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
Chrome 20.0.1132.43, OS X 10.7 (Lion): ....F............ | |
Failure: Chrome 20.0.1132.43, OS X 10.7 (Lion) modSource.getPlainHTML has style | |
[refute.equals] 0 expected not to be equal to 0 | |
at Object.<anonymous> (./test/scanforbg-test.js:27:16) | |
7 test cases, 17 tests, 18 assertions, 1 failure, 0 errors, 0 timeouts | |
Finished in 0.137s |
This file contains hidden or 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
buster.testCase("modSource.getPlainHTML", { | |
"setUp": function () { | |
// get resource | |
$jt = jQuery.noConflict(); | |
var res = $jt.ajax('simple', {async:false, cache:false}).responseText; | |
var iframe = document.createElement("iframe"); | |
document.body.appendChild(iframe); | |
// document to work with | |
var doc = iframe.contentDocument; | |
doc.open(); | |
doc.write(res); | |
doc.close(); | |
this.doc = doc; | |
}, | |
"has style": function() { | |
refute.equals(this.doc.styleSheets.length, 0); | |
assert.equals(typeof this.doc.getElementById('styletest'), 'object'); | |
} | |
}); |
This file contains hidden or 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
"has style": function(done) { | |
var me = this; | |
window.setTimeout(function() { | |
refute.equals(me.doc.styleSheets.length, 0); | |
assert.equals(typeof me.doc.getElementById('styletest'), 'object'); | |
done(); | |
}, 10); | |
// buster.log(this.doc.getElementById('styletest')); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
a