Skip to content

Commit 7b82aaa

Browse files
committed
Remove { omitDoctype: true } since it didn't actually work.
1 parent 204aabc commit 7b82aaa

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

lib/jsdom.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,8 @@ exports.env = exports.jsdom.env = function () {
191191
}
192192
};
193193

194-
exports.serializeDocument = function (doc, opts) {
195-
if (!opts) opts = {};
196-
197-
return domToHtml(opts.omitDoctype ? doc._childNodes : doc, true);
194+
exports.serializeDocument = function (doc) {
195+
return domToHtml(doc, true);
198196
};
199197

200198
function processHTML(config) {

test/jsdom/env.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ exports["explicit config.html, full document"] = function (t) {
2222
url: "http://example.com/",
2323
done: function (err, window) {
2424
t.ifError(err);
25-
t.equal(serializeDocument(window.document, { omitDoctype: true }), "<!DOCTYPE html><html><head><title>Hi</title></head><body>Hello</body></html>");
25+
t.equal(serializeDocument(window.document), "<!DOCTYPE html><html><head><title>Hi</title></head><body>Hello</body></html>");
2626
t.equal(window.location.href, "http://example.com/");
2727
t.equal(window.location.origin, "http://example.com");
2828
t.done();
@@ -36,7 +36,7 @@ exports["explicit config.html, with overriden config.url"] = function (t) {
3636
url: "http://example.com/",
3737
done: function (err, window) {
3838
t.ifError(err);
39-
t.equal(serializeDocument(window.document, { omitDoctype: true }), "<html><head></head><body>Hello</body></html>");
39+
t.equal(serializeDocument(window.document), "<html><head></head><body>Hello</body></html>");
4040
t.equal(window.location.href, "http://example.com/");
4141
t.equal(window.location.origin, "http://example.com");
4242
t.equal(window.location.search, "");
@@ -99,7 +99,7 @@ exports["explicit config.html, a string that is also a valid URL"] = function (t
9999
url: "http://example.com/",
100100
done: function (err, window) {
101101
t.ifError(err);
102-
t.equal(serializeDocument(window.document, { omitDoctype: true }), "<html><head></head><body>http://example.com/</body></html>");
102+
t.equal(serializeDocument(window.document), "<html><head></head><body>http://example.com/</body></html>");
103103
t.equal(window.location.href, "http://example.com/");
104104
t.done();
105105
}
@@ -113,7 +113,7 @@ exports["explicit config.html, a string that is also a valid file"] = function (
113113
url: "http://example.com/",
114114
done: function (err, window) {
115115
t.ifError(err);
116-
t.equal(serializeDocument(window.document, { omitDoctype: true }), "<html><head></head><body>" + body + "</body></html>");
116+
t.equal(serializeDocument(window.document), "<html><head></head><body>" + body + "</body></html>");
117117
t.equal(window.location.href, "http://example.com/");
118118
t.done();
119119
}
@@ -134,7 +134,7 @@ exports["explicit config.url, valid"] = function (t) {
134134
url: "http://localhost:8976/",
135135
done: function (err, window) {
136136
t.ifError(err);
137-
t.equal(serializeDocument(window.document, { omitDoctype: true }), responseText);
137+
t.equal(serializeDocument(window.document), responseText);
138138
t.equal(window.location.href, "http://localhost:8976/");
139139
t.equal(window.location.origin, "http://localhost:8976");
140140
t.done();
@@ -160,7 +160,7 @@ exports["explicit config.file, valid"] = function (t) {
160160
file: fileName,
161161
done: function (err, window) {
162162
t.ifError(err);
163-
t.equal(serializeDocument(window.document, { omitDoctype: true }), '<!DOCTYPE html><html><head>\n\
163+
t.equal(serializeDocument(window.document), '<!DOCTYPE html><html><head>\n\
164164
<title>hello, Node.js!</title>\n\
165165
</head>\n\
166166
<body>\n\
@@ -228,7 +228,7 @@ exports["string, parseable as a URL, valid"] = function (t) {
228228
"http://localhost:8976/",
229229
function (err, window) {
230230
t.ifError(err);
231-
t.equal(serializeDocument(window.document, { omitDoctype: true }), responseText);
231+
t.equal(serializeDocument(window.document), responseText);
232232
t.equal(window.location.href, "http://localhost:8976/");
233233
t.equal(window.location.origin, "http://localhost:8976");
234234
t.done();
@@ -254,7 +254,7 @@ exports["string, for an existing filename"] = function (t) {
254254
fileName,
255255
function (err, window) {
256256
t.ifError(err);
257-
t.equal(serializeDocument(window.document, { omitDoctype: true }), '<!DOCTYPE html><html><head>\n\
257+
t.equal(serializeDocument(window.document), '<!DOCTYPE html><html><head>\n\
258258
<title>hello, Node.js!</title>\n\
259259
</head>\n\
260260
<body>\n\
@@ -274,7 +274,7 @@ exports["string, does not exist as a file"] = function (t) {
274274
body,
275275
function (err, window) {
276276
t.ifError(err);
277-
t.equal(serializeDocument(window.document, { omitDoctype: true }), "<html><head></head><body>" + body + "</body></html>");
277+
t.equal(serializeDocument(window.document), "<html><head></head><body>" + body + "</body></html>");
278278
t.done();
279279
}
280280
);
@@ -285,7 +285,7 @@ exports["string, full HTML document"] = function (t) {
285285
"<!DOCTYPE html><html><head><title>Hi</title></head><body>Hello</body></html>",
286286
function (err, window) {
287287
t.ifError(err);
288-
t.equal(serializeDocument(window.document, { omitDoctype: true }), "<!DOCTYPE html><html><head><title>Hi</title></head><body>Hello</body></html>");
288+
t.equal(serializeDocument(window.document), "<!DOCTYPE html><html><head><title>Hi</title></head><body>Hello</body></html>");
289289
t.done();
290290
}
291291
);

0 commit comments

Comments
 (0)