Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SyntaxErorr When Module Contains Import Statement #170

Closed
bookercodes opened this issue Nov 8, 2015 · 2 comments
Closed

SyntaxErorr When Module Contains Import Statement #170

bookercodes opened this issue Nov 8, 2015 · 2 comments

Comments

@bookercodes
Copy link
Contributor

Problem

When a module contains an ES2015 import statement I get a SyntaxError:

ava test.js 

/home/booker/Code/ava-test/index.js:1
(function (exports, require, module, __filename, __dirname) { import _ from "lodash";
                                                              ^^^^^^

SyntaxError: Unexpected reserved word

How to reproduce

nvm use 5.0.0
npm install -g ava
npm install ava
npm install lodash

index.js:

import _ from "lodash";

test.js

import test from 'ava';
import sut from "./";
ava
@sindresorhus
Copy link
Member

AVA doesn't transpile your code, only your test file.

You probably want #111.

@bookercodes
Copy link
Contributor Author

Thanks, @sindresorhus. I'll look into that now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants