问题是在运行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 />);
});
});