Skip to content

Commit

Permalink
[Tests] skip template literal tests unless supported
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Jan 6, 2018
1 parent 7a6116c commit 2ab8502
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 2 deletions.
12 changes: 12 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Expand Up @@ -76,6 +76,7 @@
"browser-unpack": "^1.1.1",
"coffee-script": "~1.10.0",
"coffeeify": "~1.1.0",
"has-template-literals": "^1.0.0",
"isstream": "^0.1.2",
"make-generator-function": "^1.1.0",
"seq": "0.3.5",
Expand Down
20 changes: 19 additions & 1 deletion test/quotes.js
Expand Up @@ -2,10 +2,28 @@ var browserify = require('../');
var vm = require('vm');
var test = require('tap').test;

var hasTemplateLiterals = require('has-template-literals')();

test('quotes', function (t) {
t.plan(3);
t.plan(2);

var b = browserify(__dirname + '/quotes/main.js');
b.bundle(function (err, src) {
var c = {
done : function (single, double) {
t.equal(single, 'success', 'single quotes');
t.equal(double, 'success', 'double quotes');
t.end();
}
};
vm.runInNewContext(src, c);
});
});

test('interpolation literals', { skip: !hasTemplateLiterals }, function (t) {
t.plan(3);

var b = browserify(__dirname + '/quotes/backtick.js');
b.bundle(function (err, src) {
var c = {
done : function (single, double, backtick) {
Expand Down
1 change: 1 addition & 0 deletions test/quotes/backtick.js
@@ -0,0 +1 @@
done(require('./one.js'), require("./two.js"), require(`./three.js`));
2 changes: 1 addition & 1 deletion test/quotes/main.js
@@ -1 +1 @@
done(require('./one.js'), require("./two.js"), require(`./three.js`));
done(require('./one.js'), require("./two.js"));

0 comments on commit 2ab8502

Please sign in to comment.