运行“纱线测试/ 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 (将#修改为@)