quotes.js
1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
var browserify = require('../');
var vm = require('vm');
var test = require('tap').test;
var hasTemplateLiterals = require('has-template-literals')();
test('quotes', function (t) {
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) {
t.equal(single, 'success', 'single quotes');
t.equal(double, 'success', 'double quotes');
t.equal(backtick, 'success', 'backtick quotes');
t.end();
}
};
vm.runInNewContext(src, c);
});
});