babel-plugin-module-provider
Advanced tools
Comparing version 1.0.0 to 1.1.0
{ | ||
"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() | ||
}) | ||
}) |
6862
141