We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8be35c6 commit 073b586Copy full SHA for 073b586
2 files changed
lib/__tests__/index.js
@@ -0,0 +1,20 @@
1
+const babel = require('babel-core')
2
+const plugin = require('../index.js')
3
+const options = {
4
+ presets: [
5
+ ["es2015", {
6
+ "modules": false
7
+ }]
8
+ ],
9
+ plugins: [plugin]
10
+}
11
+
12
+it('Imports stripped', () => {
13
+ var example = `
14
+ import fs from 'fs'
15
+ import path from 'path'
16
+ `
17
18
+ const {code} = babel.transform(example, options)
19
+ expect(code.length).toBe(0)
20
+})
package.json
@@ -20,5 +20,13 @@
"repository": {
21
"type": "git",
22
"url": "https://github.com/bardiharborow/babel-plugin-transform-es2015-modules-strip.git"
23
+ },
24
+ "scripts": {
25
+ "test": "jest"
26
27
+ "devDependencies": {
28
+ "babel-core": "^6.25.0",
29
+ "babel-preset-es2015": "^6.24.1",
30
+ "jest": "^20.0.4"
31
}
32
0 commit comments