Skip to content

Instantly share code, notes, and snippets.

@sebs
Created June 27, 2012 14:54
Show Gist options
  • Save sebs/3004612 to your computer and use it in GitHub Desktop.
Save sebs/3004612 to your computer and use it in GitHub Desktop.
< 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
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"},
]
}
<html>
<head>
<script type="text/javascript"></script>
<link id="styletest" type="text/css" rel="stylesheet" media="all" href="style.css" />
</head>
<body>
</body>
</html>
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
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');
}
});
"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'));
}
@sebs
Copy link
Author

sebs commented Jun 27, 2012

a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment