You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

babel-plugin-module-provider

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-module-provider - npm Package Compare versions

Comparing version

to
1.1.0

2

package.json
{
"name": "babel-plugin-module-provider",
"version": "1.0.0",
"version": "1.1.0",
"description": "Imports modules for every file.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -40,2 +40,23 @@ import {transform} from 'babel-core'

it ('should add multiple default import statements', done => {
const modules = {
'a': 'a',
'b': 'b',
'c': 'c'
}
const actual = compile('const hello ="hello"', modules)
const expected = `
import a from "a";
import b from "b";
import c from "c";
const hello = "hello";
`
assertSame(actual, expected)
done()
})
it('should add non default import', done => {

@@ -98,4 +119,21 @@

done()
})
it('should add default and non-default statements', done => {
const modules = {
"@cycle/core": "Cycle",
"@cycle/dom": ["makeDOMDriver, h, svg"]
}
const actual = compile('const hello = "hello"', modules)
const expected = `
import Cycle from "@cycle/core";
import {makeDOMDriver, h, svg} from "@cycle/dom";
const hello = "hello";
`
assertSame(actual, expected)
done()
})
})