I use enzyme & jest for executing tests.
Even though I use syntax-dynamic-import
plugin, I am still getting the token error when I execute tests.
But, When I build the code, I didn’t get any error.
This is how my .babelrc looks,
{
"presets": ["es2015","react"],
"plugins": ["transform-object-rest-spread", "syntax-dynamic-import"]
}
Fixed it by using this dynamic import node plugin