Preprocessor to build yate template through yate on the fly.
The easiest way is to keep karma-yate-preprocessor
as a devDependency in your package.json
.
{
"devDependencies": {
"karma": "~0.10",
"karma-yate-preprocessor": "~0.1"
}
}
You can simple do it by:
npm install karma-yate-preprocessor --save-dev
Following code shows the default configuration...
// karma.conf.js
module.exports = function(config) {
config.set({
frameworks: ['yate'],
preprocessors: {
'**/*.yate': ['yate']
}
});
};
describe('yate', function() {
it('should compile yate template', function() {
expect(yr.run('main', {})).to.be.eql('Hello World!');
});
it('should compile yate template with mode', function() {
expect(yr.run('main', {}, "test")).to.be.eql('Hello World From Mode!');
});
});