-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
23 lines (20 loc) · 676 Bytes
/
Copy pathtest.js
File metadata and controls
23 lines (20 loc) · 676 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*!
* helper-resolve <https://github.com/jonschlinkert/helper-resolve>
*
* Copyright (c) 2015-2018, Jon Schlinkert.
* Licensed under the MIT License.
*/
'use strict';
/* deps:mocha jquery */
const assert = require('assert');
const handlebars = require('handlebars');
const resolve = require('./');
describe('resolve helper', function() {
it('should work as a handlebars helper:', function() {
const str = '{{resolve "jquery"}}';
handlebars.registerHelper('resolve', function(fp, key) {
return resolve.sync(fp)[typeof key === 'string' ? key : 'main'];
});
assert.equal(handlebars.compile(str)(), 'node_modules/jquery/dist/jquery.js');
});
});