-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtest.js
38 lines (32 loc) · 924 Bytes
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
var fs = require('fs')
var path = require('path')
var fixturify = require('fixturify')
var quickTemp = require('quick-temp')
var assert = require('chai').assert
var Builder = require('broccoli').Builder
var renderJade = require('./index')
describe('unit tests', function() {
it('test1', function(done) {
fixturify.writeSync(this.tempdir, {
'page.jade': 'page.jade contents',
});
var builder = new Builder(new renderJade(this.tempdir));
builder.build()
.then(function (hash) {
var output = fixturify.readSync(hash.directory);
assert.deepEqual(output, {
'page.html': '<page class="jade">contents</page>'
});
})
.finally(function () {
builder.cleanup();
})
.then(done, done)
})
beforeEach(function() {
quickTemp.makeOrRemake(this, 'tempdir');
});
after(function() {
quickTemp.remove(this, 'tempdir');
})
})