Skip to content

Commit 46f33bd

Browse files
committed
with comments
1 parent 5c85e44 commit 46f33bd

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

test/files/with_comments.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
console.log(style);
12+
module.exports = function () {
13+
// var
14+
// tag = document.createElement('style'),
15+
// content = document.createTextNode(style);
16+
17+
// tag.appendChild(content);
18+
// document.body.appendChild(tag);
19+
};

test/with_comments.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
if (err) t.fail(err);
19+
// vm.runInNewContext(src, { console: { log: log } });
20+
});
21+
22+
function log (msg) {
23+
t.equal(html, msg);
24+
}
25+
});

0 commit comments

Comments
 (0)