Skip to content

Commit 052a618

Browse files
author
Christopher Baker
committed
add fix for zombie
1 parent 29efc30 commit 052a618

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"connect": "^2.14.4",
3131
"mocha": "^3.1.2",
3232
"q": "^1.4.1",
33-
"zombie": "^4.2.1"
33+
"zombie": "^4.3.0"
3434
},
3535
"dependencies": {
3636
"prismjs": "^1.11.0"

test.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
var generate = require("bit-docs-generate-html/generate");
22
var Q = require("q");
33
var path = require("path");
4+
var fs = require("fs");
45
var assert = require("assert");
56

67
var Browser = require("zombie");
78
var connect = require("connect");
89

10+
var zombieFixes = "Object.defineProperty(HTMLElement.prototype, 'classList', { get: function() { var parent = this; var classList = parent.className.split(' '); classList.contains = classList.includes; classList.add = function(token) { this.push(token); parent.className = this.join(' '); }; return classList; } });\n\n";
11+
912
var open = function(url, callback, done) {
1013
var server = connect().use(connect.static(path.join(__dirname))).listen(8081);
1114
var browser = new Browser();
@@ -45,6 +48,9 @@ describe("bit-docs-prettify", function() {
4548
forceBuild: true
4649
})
4750
.then(function() {
51+
var stealPath = path.join(__dirname, "temp", "static", "node_modules", "steal", "steal.production.js");
52+
fs.writeFileSync(stealPath, zombieFixes + fs.readFileSync(stealPath, "utf8"));
53+
4854
open("temp/index.html", function(browser, close) {
4955
var codes = browser.window.document.getElementsByTagName("code");
5056

0 commit comments

Comments
 (0)