@@ -83,6 +83,22 @@ describe('bh-server', function () {
83
83
return assert ( bemjson , html , templates ) ;
84
84
} ) ;
85
85
86
+ it ( 'mimic to BEMHTML' , function ( ) {
87
+ var templates = [
88
+ [
89
+ 'bh.match("block", function(ctx) {' ,
90
+ 'var url = require("url");' ,
91
+ 'ctx.content(url.resolve("http://example.com/", "/pathname"));' ,
92
+ '});'
93
+ ] . join ( '\n' )
94
+ ] ,
95
+ bemjson = { block : 'block' } ,
96
+ html = '<div class="block">http://example.com/pathname</div>' ,
97
+ options = { mimic : [ 'BH' , 'BEMHTML' ] } ;
98
+
99
+ return assert ( bemjson , html , templates , options ) ;
100
+ } ) ;
101
+
86
102
it ( 'must correctly resolve path' , function ( ) {
87
103
var template = [
88
104
'bh.match("block", function(ctx) {' ,
@@ -263,5 +279,8 @@ function assert(bemjson, html, templates, options) {
263
279
return bundle . runTechAndRequire ( bhServer , options )
264
280
. spread ( function ( bh ) {
265
281
bh . apply ( bemjson ) . must . be ( html ) ;
282
+ options && options . mimic && options . mimic . forEach ( function ( name ) {
283
+ bh [ name ] . apply ( bemjson ) . must . be ( html ) ;
284
+ } ) ;
266
285
} ) ;
267
286
}
0 commit comments