File tree Expand file tree Collapse file tree 2 files changed +47
-0
lines changed Expand file tree Collapse file tree 2 files changed +47
-0
lines changed Original file line number Diff line number Diff line change
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
+ } ;
Original file line number Diff line number Diff line change
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
+ } ) ;
You can’t perform that action at this time.
0 commit comments