Revisions
-
chapel revised this gist
Aug 28, 2015 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,6 @@ // String interpolation in ES6 var runner = require('./setup'); exports.lab = runner.lab; // Add this so the tests don't fail runner.run(function(describe, it, before, after, expect) { describe('template strings, are wrapped in backticks', function () { -
Anthony Bouch created this gist
Aug 28, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ // Lab setup var Code = require('code'); var Lab = require('lab'); var lab = exports.lab = Lab.script(); var describe = lab.describe; var it = lab.it; var before = lab.before; var after = lab.after; var expect = Code.expect; exports.run = function(tests) { tests(describe, it, before, after, expect); }; This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ // String interpolation in ES6 var runner = require('./setup'); runner.run(function(describe, it, before, after, expect) { describe('template strings, are wrapped in backticks', function () { it('prints x into a string using ${x}', function (done) { var x = 42; expect(`x=${x}`).to.equal('x=' + x); done(); }); it('add two numbers inside the ${...}', function (done) { var x = 42; var y = 23; expect(`${ x + y}`).to.equal((x + y).toString()); done(); }); it('get a function call result inside ${...}', function (done) { function getDomain() { return 'tddbin.com'; } expect(`${ getDomain() }`).to.equal('tddbin.com'); done(); }); }); });