Javascript 语法?。jest在导入包时抛出错误 我在本地计算机上用一些有用的功能制作了自己的npm包,用jest测试了它的工作,并发表在npm上。一切正常 我在codesandbox上创建了这个项目,导入了我的包,它工作得很好 然后我在我的计算机上创建了另一个npm包,从第一个包中导入了函数,创建了测试文件,运行了jest测试,并得到了一个错误
Jest遇到了意外的标记Javascript 语法?。jest在导入包时抛出错误 我在本地计算机上用一些有用的功能制作了自己的npm包,用jest测试了它的工作,并发表在npm上。一切正常 我在codesandbox上创建了这个项目,导入了我的包,它工作得很好 然后我在我的计算机上创建了另一个npm包,从第一个包中导入了函数,创建了测试文件,运行了jest测试,并得到了一个错误,javascript,node.js,babel-jest,Javascript,Node.js,Babel Jest,Jest遇到了意外的标记 This usually means that you are trying to import a file which Jest cannot parse, e.g. it's not plain JavaScript. By default, if Jest sees a Babel config, it will use that to transform your files, ignoring "node_modules". 呜呜呜呜
This usually means that you are trying to import a file which Jest cannot parse, e.g. it's not plain JavaScript.
By default, if Jest sees a Babel config, it will use that to transform your files, ignoring "node_modules".
呜呜呜呜
详情:
C:\OSPanel\domains\localhost\js projects\sql for js simple\node\u modules\split smartly\index.js:452
(搜索设置.提及?[fragment]&&ACTION\u ADD\u fragment)
^
SyntaxError:意外标记
在我的第一个包裹里。所以玩笑不能理解
searchSettings.提及?[片段]
奇怪的是:
- jest理解第一个包中的语法
- 第二个包jest中的语法可以理解
- 但这个语法在第一个包导入到第二个包时并不理解