Skip to content

Commit

Permalink
test: fix tests for prev commit
Browse files Browse the repository at this point in the history
  • Loading branch information
bbmoz committed Apr 25, 2017
1 parent effc1ea commit 67cd79d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/test/AstParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,31 @@ import AstParser from './../src/AstParser'
test('.parse(path, text): ast of import and export *', t => {
const text = 'import foo from "bar"; export * from "bar";'
const ast = astParser.parse(path, text)
const expectedImports = { bar: 'foo' }
const expectedImports = { '/hello/app/bar.js': 'foo' }
const expectedExports = { all: 'bar' }
moduleEquals(ast, t, expectedImports, expectedExports)
})

test('.parse(path, text): ast of import and export default', t => {
const text = 'import foo from "bar"; const a = 2; export default a;'
const ast = astParser.parse(path, text)
const expectedImports = { bar: 'foo' }
const expectedImports = { '/hello/app/bar.js': 'foo' }
const expectedExports = { default: 'a' }
moduleEquals(ast, t, expectedImports, expectedExports)
})

test('.parse(path, text): ast of import and export', t => {
const text = 'import foo from "bar"; const a = 2; export { a };'
const ast = astParser.parse(path, text)
const expectedImports = { bar: 'foo' }
const expectedImports = { '/hello/app/bar.js': 'foo' }
const expectedExports = { named: ['a'] }
moduleEquals(ast, t, expectedImports, expectedExports)
})

test('.parse(path, text): ast of import, export, and export default', t => {
const text = 'import foo from "bar"; import dog from "cat"; const a = 2; const b = 3; export { a }; export default b;'
const ast = astParser.parse(path, text)
const expectedImports = { bar: 'foo', cat: 'dog' }
const expectedImports = { '/hello/app/bar.js': 'foo', '/hello/app/cat.js': 'dog' }
const expectedExports = { named: ['a'], default: 'b' }
moduleEquals(ast, t, expectedImports, expectedExports)
})
Expand Down

0 comments on commit 67cd79d

Please sign in to comment.