initial
This commit is contained in:
1
test/hbs_testfiles/data.json
Normal file
1
test/hbs_testfiles/data.json
Normal file
@ -0,0 +1 @@
|
||||
{}
|
1
test/hbs_testfiles/index.hbs
Normal file
1
test/hbs_testfiles/index.hbs
Normal file
@ -0,0 +1 @@
|
||||
{{> partials/header}}
|
0
test/hbs_testfiles/partials/footer.hbs
Normal file
0
test/hbs_testfiles/partials/footer.hbs
Normal file
1
test/hbs_testfiles/partials/header.hbs
Normal file
1
test/hbs_testfiles/partials/header.hbs
Normal file
@ -0,0 +1 @@
|
||||
<head></head>
|
1
test/test.d.ts
vendored
Normal file
1
test/test.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
import 'typings-test';
|
16
test/test.js
Normal file
16
test/test.js
Normal file
@ -0,0 +1,16 @@
|
||||
"use strict";
|
||||
require("typings-test");
|
||||
const smarthbs = require("../dist/index");
|
||||
const path = require("path");
|
||||
let testHbsDir = path.join(__dirname, 'hbs_testfiles');
|
||||
let testPartialDir = path.join(testHbsDir, 'partials');
|
||||
let testResultDir = path.join(__dirname, 'testresult');
|
||||
describe('smarthbs', function () {
|
||||
it('should create partials', function () {
|
||||
smarthbs.registerPartialDir(testPartialDir);
|
||||
});
|
||||
it('should compile a directory', function () {
|
||||
smarthbs.compileDirectory(testHbsDir, testResultDir, 'data.json');
|
||||
});
|
||||
});
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLHdCQUFxQjtBQUNyQiwwQ0FBeUM7QUFDekMsNkJBQTRCO0FBRTVCLElBQUksVUFBVSxHQUFHLElBQUksQ0FBQyxJQUFJLENBQUMsU0FBUyxFQUFFLGVBQWUsQ0FBQyxDQUFBO0FBQ3RELElBQUksY0FBYyxHQUFHLElBQUksQ0FBQyxJQUFJLENBQUMsVUFBVSxFQUFFLFVBQVUsQ0FBQyxDQUFBO0FBQ3RELElBQUksYUFBYSxHQUFHLElBQUksQ0FBRSxJQUFJLENBQUMsU0FBUyxFQUFFLFlBQVksQ0FBQyxDQUFBO0FBQ3ZELFFBQVEsQ0FBQyxVQUFVLEVBQUU7SUFFakIsRUFBRSxDQUFDLHdCQUF3QixFQUFFO1FBQ3pCLFFBQVEsQ0FBQyxrQkFBa0IsQ0FBQyxjQUFjLENBQUMsQ0FBQTtJQUMvQyxDQUFDLENBQUMsQ0FBQTtJQUVGLEVBQUUsQ0FBQyw0QkFBNEIsRUFBRTtRQUM3QixRQUFRLENBQUMsZ0JBQWdCLENBQUMsVUFBVSxFQUFFLGFBQWEsRUFBRSxXQUFXLENBQUMsQ0FBQTtJQUNyRSxDQUFDLENBQUMsQ0FBQTtBQUVOLENBQUMsQ0FBQyxDQUFBIn0=
|
18
test/test.ts
Normal file
18
test/test.ts
Normal file
@ -0,0 +1,18 @@
|
||||
import 'typings-test'
|
||||
import * as smarthbs from '../dist/index'
|
||||
import * as path from 'path'
|
||||
|
||||
let testHbsDir = path.join(__dirname, 'hbs_testfiles')
|
||||
let testPartialDir = path.join(testHbsDir, 'partials')
|
||||
let testResultDir = path .join(__dirname, 'testresult')
|
||||
describe('smarthbs', function() {
|
||||
|
||||
it('should create partials', function(){
|
||||
smarthbs.registerPartialDir(testPartialDir)
|
||||
})
|
||||
|
||||
it('should compile a directory', function() {
|
||||
smarthbs.compileDirectory(testHbsDir, testResultDir, 'data.json')
|
||||
})
|
||||
|
||||
})
|
1
test/testresult/index.html
Normal file
1
test/testresult/index.html
Normal file
@ -0,0 +1 @@
|
||||
<head></head>
|
Reference in New Issue
Block a user