Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieyang committed Feb 26, 2016
1 parent 273bc3d commit 02a6a2b
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/relative/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
'use strict';
var expect = require("expect.js");
expect(
require("../..")
.call({resourcePath: __dirname + '/tpl/question/question.tpl'})
.indexOf("require('./choose/choose.tpl')") != -1
).to.be(true);
console.log('通过');
24 changes: 24 additions & 0 deletions test/relative/tpl/question/choose/choose.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{{if body}}
<div class="first-title">
<h3>{{#body}}</h3>
</div>
{{/if}}
<ul class="chooses">
{{if type == 4}}
<li class="clearFix" data-value="1">
<div class="choose-mark">√</div>
<div class="choose-content">正确</div>
</li>
<li class="clearFix" data-value="0">
<div class="choose-mark">X</div>
<div class="choose-content">错误</div>
</li>
{{else}}
{{each subjectItems}}
<li class="clearFix" data-value="{{$value.value}}">
<div class="choose-mark">{{$value.value}}</div>
<div class="choose-content">{{#$value.content}}</div>
</li>
{{/each}}
{{/if}}
</ul>
1 change: 1 addition & 0 deletions test/relative/tpl/question/question.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{include './choose/choose'}}

0 comments on commit 02a6a2b

Please sign in to comment.