UNPKG

534 BJavaScriptView Raw
1/**
2 * Test case for tmplSet.
3 * Runs with nodeunit.
4 */
5'use strict'
6
7const TmplSet = require('../lib/sets/tmpl_set.js')
8const assert = require('assert')
9
10it('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 */