-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathtest.js
More file actions
26 lines (23 loc) · 851 Bytes
/
test.js
File metadata and controls
26 lines (23 loc) · 851 Bytes
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
var transform = require('babel-core').transform;
var strictEqual = require('assert').strictEqual;
var babelPresetEs2015Rollup = require('./');
describe('babel-preset-es2015-rollup', function() {
it('transforms ES2015 features that are not modules', function() {
strictEqual(
transform('() => {};', { presets: [babelPresetEs2015Rollup] }).code,
'(function () {});'
);
});
it('does not transform imports or exports', function() {
strictEqual(
transform('import "foo";\nexport default 0;', { presets: [babelPresetEs2015Rollup] }).code,
'import "foo";\nexport default 0;'
);
});
it('uses external helpers', function() {
strictEqual(
transform('typeof a;', { presets: [babelPresetEs2015Rollup] }).code,
'typeof a === "undefined" ? "undefined" : babelHelpers.typeof(a);'
);
});
});