微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

运行“纱线测试/ npm运行测试”时在specter.scss上获取错误

如何解决运行“纱线测试/ npm运行测试”时在specter.scss上获取错误

问题是在运行npm测试/纱线测试时

请在下面看到错误,我收到了SyntaxError:spectre.scss中的无效或意外令牌。我没有触摸或输入任何代码

Austine-Temp:mule-starter wslemployee$ yarn test
yarn run v1.22.10
$ jest --reporters=jest-standard-reporter
 FAIL  src/App.test.js
  ● Test suite Failed to run

    /src/styles/spectre.scss:2
    @import "variables";
    ^

    SyntaxError: Invalid or unexpected token

    > 1 | import './styles/spectre.scss'
        | ^
      2 | import './styles/spectre-exp.scss'
      3 | import './styles/spectre-icons.scss'
      4 | import './styles/custom.scss'

      at ScriptTransformer._transformAndBuildScript (node_modules/@jest/transform/build/ScriptTransformer.js:537:17)
      at ScriptTransformer.transform (node_modules/@jest/transform/build/ScriptTransformer.js:579:25)
      at Object.<anonymous> (src/App.js:1:1)

Test Suites: 1 Failed,1 total
Tests:       0 total
Snapshots:   0 total
Time:        3.188s
error Command Failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. 

这是我的App.test.js。到目前为止,几乎没有代码

import React from "react";
import App from "./App";
import { shallow,mount } from "enzyme";
import toJson from "enzyme-to-json";

describe("rendering components",() => {
  it("renders App component without crashing",() =>{
    shallow(<App />);
  });
}); 

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。