Skip to content
This repository was archived by the owner on Jan 11, 2019. It is now read-only.

tape-to-ava - SyntaxError: Unexpected token export #34

Closed
esganzerla opened this issue Dec 19, 2016 · 2 comments
Closed

tape-to-ava - SyntaxError: Unexpected token export #34

esganzerla opened this issue Dec 19, 2016 · 2 comments

Comments

@esganzerla
Copy link

I just tried using tape-to-ava and got this error on terminal.

➜  serializeJSON tape-to-ava serializeJSON.test.js -f
fatal: Not a git repository (or any of the parent directories): .git
WARNING: Unable to determine if git directory is clean. Forcibly continuing. Ensure you have a backup of your tests or commit the latest changes before continuing.
Executing command: jscodeshift -t /usr/local/lib/node_modules/ava-codemods/lib/tape.js serializeJSON.test.js
Processing 1 files...
Spawning 1 workers...
Sending 1 files to free worker...
/usr/local/lib/node_modules/ava-codemods/lib/tape.js:115
export default function tapeToAva(fileInfo, api) {
^^^^^^
SyntaxError: Unexpected token export
    at Object.exports.runInThisContext (vm.js:78:16)
    at Module._compile (module.js:543:28)
    at Module._extensions..js (module.js:580:10)
    at Object.require.extensions.(anonymous function) [as .js] (/usr/local/lib/node_modules/ava-codemods/node_modules/babel-register/lib/node.js:152:7)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at setup (/usr/local/lib/node_modules/ava-codemods/node_modules/jscodeshift/dist/Worker.js:67:18)
All done.
Results:
0 errors
0 unmodified
0 skipped
0 ok
Time elapsed: 2.567seconds

I'm running on node 7.2.1.

@novemberborn
Copy link
Member

We're distributing the lib/tape.js transformer module as ES2015, which is surprising to me.

I suspect jscodeshift used to transpile that module, which has now stopped working. https://github.com/facebook/jscodeshift/releases/tag/v0.3.21 seems of interest.

@dawsbot
Copy link
Contributor

dawsbot commented Jan 24, 2017

@novemberborn any progress on this? If tape-to-ava does not work on any node version it seems like it should be deprecated/removed entirely from ava-codemods.

UPDATE: PR'd a fix #35

novemberborn pushed a commit that referenced this issue Jan 25, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants