UNPKG

688 BJavaScriptView Raw
1describe('Preset', () => {
2 let preset;
3 let babel;
4
5 beforeEach(() => {
6 babel = require('@babel/core');
7 preset = require('../');
8 });
9
10 it('should be a valid config', () => {
11 const opts = babel.loadOptions({
12 presets: [[preset]],
13 babelrc: false,
14 });
15
16 expect(opts.plugins).not.toHaveLength(0);
17 });
18});
19
20describe('Preset esm', () => {
21 let preset;
22 let babel;
23
24 beforeEach(() => {
25 babel = require('@babel/core');
26 preset = require('../esm');
27 });
28
29 it('should be a valid config', () => {
30 const opts = babel.loadOptions({
31 presets: [[preset]],
32 babelrc: false,
33 });
34
35 expect(opts.plugins).not.toHaveLength(0);
36 });
37});