Skip to content

Commit

Permalink
fix: unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
Arun-KumarH committed Feb 26, 2024
1 parent 74c70bc commit 0800d98
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/handlebars-helperized/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"scripts": {
"lint": "eslint src --ext .ts ",
"pretest": "npm run build",
"test": "nyc mocha ./test/* --exit",
"test": "nyc mocha ./test/* --timeout 5000 --exit",
"build:tsc": "tsc -d",
"build:clean": "rimraf lib",
"build": "npm-run-all lint build:clean build:tsc",
Expand Down
11 changes: 6 additions & 5 deletions packages/handlebars-helperized/test/test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
'use strict';

/* eslint-env node, mocha */

// eslint-disable-next-line
const should = require('should');
const fs = require('fs');
Expand Down Expand Up @@ -50,10 +46,15 @@ describe('the handlebars template engine', () => {
done();
});

it('should be able to render templates with a provided custom helper', () => {
it('should be able to render templates with a provided custom helper', async () => {
const filePathList = ['../test/handlebars/helper-loud.js'];
const tpl = '<h1>Hello {{loud name}}</h1>';
const renderer = new Renderer(tpl, '', '', {}, filePathList );
await new Promise((resolve, reject) => {
setTimeout(() => {
resolve();
}, 2000)
});
const result = renderer.render({ name: 'John' });
const expectedResult = '<h1>Hello JOHN</h1>';
result.should.equal(expectedResult);
Expand Down

0 comments on commit 0800d98

Please sign in to comment.