Skip to content

Commit 045d416

Browse files
Sebmasterdomenic
authored andcommitted
Fix whitespace in expected html
The expected html is actually not the same as what's in the file. Checked with Chrome to match exactly.
1 parent 50096f3 commit 045d416

File tree

1 file changed

+29
-23
lines changed

1 file changed

+29
-23
lines changed

test/jsdom/env.js

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -154,17 +154,20 @@ exports["explicit config.url, invalid"] = function (t) {
154154
exports["explicit config.file, valid"] = function (t) {
155155
var fileName = path.resolve(__dirname, "files/env.html");
156156

157-
fs.readFile(fileName, 'utf-8', function (err, text) {
158-
t.ifError(err);
159-
env({
160-
file: fileName,
161-
done: function (err, window) {
162-
t.ifError(err);
163-
t.equal(window.document.innerHTML, text.trim());
164-
t.equal(window.location.href, toFileUrl(fileName));
165-
t.done();
166-
}
167-
});
157+
env({
158+
file: fileName,
159+
done: function (err, window) {
160+
t.ifError(err);
161+
t.equal(window.document.innerHTML, '<!DOCTYPE html><html><head>\n\
162+
<title>hello, Node.js!</title>\n\
163+
</head>\n\
164+
<body>\n\
165+
\n\
166+
\n\
167+
</body></html>');
168+
t.equal(window.location.href, toFileUrl(fileName));
169+
t.done();
170+
}
168171
});
169172
};
170173

@@ -245,18 +248,21 @@ exports["string, parseable as a URL, invalid"] = function (t) {
245248
exports["string, for an existing filename"] = function (t) {
246249
var fileName = path.resolve(__dirname, "files/env.html");
247250

248-
fs.readFile(fileName, 'utf-8', function (err, text) {
249-
t.ifError(err);
250-
env(
251-
fileName,
252-
function (err, window) {
253-
t.ifError(err);
254-
t.equal(window.document.innerHTML, text.trim());
255-
t.equal(window.location.href, toFileUrl(fileName));
256-
t.done();
257-
}
258-
);
259-
});
251+
env(
252+
fileName,
253+
function (err, window) {
254+
t.ifError(err);
255+
t.equal(window.document.innerHTML, '<!DOCTYPE html><html><head>\n\
256+
<title>hello, Node.js!</title>\n\
257+
</head>\n\
258+
<body>\n\
259+
\n\
260+
\n\
261+
</body></html>');
262+
t.equal(window.location.href, toFileUrl(fileName));
263+
t.done();
264+
}
265+
);
260266
};
261267

262268
exports["string, does not exist as a file"] = function (t) {

0 commit comments

Comments
 (0)