1 | /**
|
2 | * Test case for tmplSet.
|
3 | * Runs with nodeunit.
|
4 | */
|
5 |
|
6 |
|
7 | const TmplSet = require('../lib/sets/tmpl_set.js')
|
8 | const assert = require('assert')
|
9 |
|
10 | it('Register and resolve tmpls.', (done) => {
|
11 | let tmplSet = new TmplSet()
|
12 | tmplSet.registerTmpl('foo', function () {
|
13 | })
|
14 | assert.throws(function () {
|
15 | tmplSet.registerTmpl('foo', function () {
|
16 | })
|
17 | }, 'Try to register duplicate name')
|
18 | assert.ok(tmplSet.resolveTmpl(function () {
|
19 | }))
|
20 | assert.ok(tmplSet.resolveTmpl('foo'))
|
21 | done()
|
22 | })
|
23 |
|
24 | /* global describe, it */
|