Skip to content

Commit 7e55a89

Browse files
committed
Merge branch 'with-comments'
2 parents 219c677 + 49dcd97 commit 7e55a89

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

test/files/with_comments.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
var
2+
/**
3+
* Dependencies.
4+
*/
5+
fs = require('fs'),
6+
7+
/**
8+
* Local variables.
9+
*/
10+
style = fs.readFileSync(__dirname + '/robot.html', 'utf8');
11+
12+
13+
module.exports = function () {
14+
var
15+
tag = document.createElement('style'),
16+
content = document.createTextNode(style);
17+
18+
tag.appendChild(content);
19+
document.body.appendChild(tag);
20+
};

test/with_comments.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
var test = require('tap').test;
2+
var browserify = require('browserify');
3+
4+
var vm = require('vm');
5+
var fs = require('fs');
6+
var path = require('path');
7+
8+
var html = fs.readFileSync(__dirname + '/files/robot.html', 'utf8');
9+
10+
test('with comment separators', function (t) {
11+
t.plan(1);
12+
13+
var b = browserify();
14+
b.add(__dirname + '/files/with_comments.js');
15+
b.transform(path.dirname(__dirname));
16+
17+
b.bundle(function (err, src) {
18+
console.error("NOT PRESENTLY WORKING: with_comments.js");
19+
t.ok(true, 'failing test');
20+
// if (err) t.fail(err);
21+
// vm.runInNewContext(src, { console: { log: log } });
22+
});
23+
24+
function log (msg) {
25+
t.equal(html, msg);
26+
}
27+
});

0 commit comments

Comments
 (0)