I have a class that I am trying to import for testing.
// animal.js
export default class Animal {
// code here
}
then in my test.js file I have the following:
import Animal from './animal.js
When I run yarn start test I see the following error message.
import Animal from './animal.js';
^^^^
SyntaxError: Unexpected identifier at new Script (vm.js:83:7)
My package.json file looks like this
{
"name": "animal",
"version": "1.0.0",
"description": "",
"main": "lazy.js",
"scripts": {
"test": "mocha"
},
"devDependencies": {
"chai": "^4.1.1",
"mocha": "^3.5.0"
}
}