我刚刚添加了测试单元,当我使用 运行它时npm run unit
,出现错误并且测试将失败。但是,当我运行npm run dev
一切看起来都很好时,我不知道发生了什么黑客攻击。我想当我运行时npm run unit
,sass-loader
无法识别部分文件并会抛出新错误variable undefined
。
这是我的代码 https://github.com/rohmanhm/unobuilder/tree/test
这是错误消息。
✘ rohmanhm ~/Desktop/Code/Works/unobuilder test sudo yarn unit yarn unit v0.20.3 $ cross-env BABEL_ENV=test karma start test/unit/karma.conf.js --single-run Hash: 6fdcbeffca85c85952cb版本:webpack 2.2.1 时间:59663ms 资产大小块块名称 static/fonts/lato100.ded7187.woff2 23.5 kB [emitted] static/img/icons.76d3910.svg 49.4 kB [emitted] static/fonts/lato300.100dadd。 eot 32.7 kB [已发布] 静态/fonts/lato700.43a8fa5.eot 35.2 kB [已发布] 静态/fonts/lato900.4f7ab78.eot 33.8 kB [已发布] 静态/fonts/OpenSans-Bold.7ae9b8b。eot 110 kB [发出] static/fonts/OpenSans-BoldItalic.ea07932.eot 128 kB [发出] static/fonts/OpenSans-ExtraBold.561e4b6.eot 107 kB [发出] static/fonts/OpenSans-ExtraBoldItalic.5f467e7.eot 124 kB [发出] static/fonts/OpenSans-Italic.e487b7c.eot 131 kB [发出] static/fonts/OpenSans-Light.8040375.eot 108 kB [发出] static/fonts/OpenSans-LightItalic.6725fc4.eot 133 kB [发出] static/fonts/OpenSans-Regular.a35546e.eot 106 kB [发出] static/fonts/OpenSans-Semibold.0ea0450.eot 108 kB [发出] static/fonts/OpenSans-SemiboldItalic.da06141.eot 131 kB [发出]静态/img/lato100.1e9336b。svg 233 kB [发出] static/img/lato300.1aed0c8.svg 236 kB [发出] static/img/lato700.cfdfec6.svg 250 kB [发出] [大] static/img/lato900.030643b.svg 238 kB [发出] static/img/OpenSans-Bold.d6291f8.svg 270 kB [发出] [大] static/img/OpenSans-BoldItalic.a54aba8.svg 291 kB [发出] [大] static/img/OpenSans-ExtraBold.c1deb2d.svg 272 kB [发出] [大] static/img/OpenSans-ExtraBoldItalic.9704305.svgd6291f8.svg 270 kB [发射] [大] static/img/OpenSans-BoldItalic.a54aba8.svg 291 kB [发射] [大] static/img/OpenSans-ExtraBold.c1deb2d.svg 272 kB [发射] [大] 静态/img/OpenSans-ExtraBoldItalic.9704305.svgd6291f8.svg 270 kB [发射] [大] static/img/OpenSans-BoldItalic.a54aba8.svg 291 kB [发射] [大] static/img/OpenSans-ExtraBold.c1deb2d.svg 272 kB [发射] [大] 静态/img/OpenSans-ExtraBoldItalic.9704305.svg
290 kB [发出] [大] static/img/OpenSans-Italic.d6671d4.svg 298 kB [发出] [大] static/img/OpenSans-Light.d79f021.svg 264 kB [发出] [大] static/img/ OpenSans-LightItalic.b64e991.svg 298 kB [已发布] [大] static/img/OpenSans-Regular.f641a7d.svg 272 kB [已发布] [大] static/img/OpenSans-Semibold.66da250.svg 270 kB [已发布] [大] static/img/OpenSans-SemiboldItalic.ddc348f.svg 296 kB [发出] [大] static/fonts/lato100.4abb6ba.ttf 76.1 kB [发出] static/fonts/lato100.126c1aa.woff 33.3 kB [发出]静态/字体/lato100.f8e1b1b.eot 30.2 kB [发出]静态/字体/lato300.ad9795e。ttf 83.3 kB [发出] static/fonts/lato300.6f934cd.woff 36.3 kB [发出] static/fonts/lato300.3e86c49.woff2 25.4 kB [发出] static/fonts/lato700.a30435e.ttf 82.4 kB [发出] static/ fonts/lato700.fd37395.woff 35.9 kB [发出] static/fonts/lato700.649e18e.woff2 25.6 kB [发出] static/fonts/lato900.01f5fcc.ttf 77 kB [发出] static/fonts/lato900.c208c97.woff 34.4 kB [发出] static/fonts/lato900.f377f44.woff2 25.4 kB [发出] static/fonts/OpenSans-Bold.5a10091.ttf 110 kB [发出] static/fonts/OpenSans-Bold.8926673.woff 63。6 kB [发出] static/fonts/OpenSans-BoldItalic.c36b5ac.ttf 128 kB [发出] static/fonts/OpenSans-BoldItalic.7be88e7.woff 73.6 kB [发出] static/fonts/OpenSans-ExtraBold.5d29c43.ttf 107 kB [发出] static/fonts/OpenSans-ExtraBold.3ae3245.woff 62.5 kB [发出] static/fonts/OpenSans-ExtraBoldItalic.4595d7f.ttf 124 kB [发出] static/fonts/OpenSans-ExtraBoldItalic.4f44077.woff 71.7 kB [发出] static/fonts/OpenSans-Italic.9b30f13.ttf 131 kB [发出] static/fonts/OpenSans-Italic.5250746.woff 76.1 kB [发出] static/fonts/OpenSans-Light.ecb4572.ttf 107 kB [发出] 静态/fonts/OpenSans-Light.963eb32.woff 62.8 kB [发出] 静态/fonts/OpenSans-LightItalic。26f1e68.ttf 133 kB [发出] static/fonts/OpenSans-LightItalic.97534dd.woff 76.4 kB [发出] static/fonts/OpenSans-Regular.cd72963.ttf 106 kB [发出] static/fonts/OpenSans-Regular.ac327c4。 woff 63.7 kB [发出] static/fonts/OpenSans-Semibold.b5a0ae8.ttf 108 kB [发出] static/fonts/OpenSans-Semibold.56bfcae.woff 64.4 kB [发出] static/fonts/OpenSans-SemiboldItalic.1c0b4eb.ttf 131 kB [emitted] static/fonts/OpenSans-SemiboldItalic.ec55f26.woff 75.6 kB [emitted] index.js 12.5 MB 0 [emitted] [big] index.js 块 {0} index.js (index.js) 5.22 MB [条目] [渲染] [5] ./src/utils.js 61.3 kB {0} [内置] [11] (webpack)/buildin/global.js 509 字节 {0} [内置] [12] ./src/store/mutation-types.js 11.8 kB {0} [内置] [14] ./src/client.js 96.6 kB {0} [内置] [ 57] ./~/vue/dist/vue.common.js 242 kB {0} [内置] [153] ./~/function-bind/index.js 111 字节 {0} [内置] [186] ./ src ^./(?!main(.js)?$) 11.1 kB {0} [内置]
[187] ./test/unit/specs .spec$ 177 字节 {0} [内置] [463] ./src/assets/scss/layout/_properties.scss 1.21 kB {0} [可选] [内置] [464 ] ./src/assets/scss/layout/_right_panel.scss 1.21 kB {0} [可选] [内置] [465] ./src/assets/scss/layout/_screen_tools.scss 1.21 kB {0} [可选] [内置] [466] ./src/assets/scss/layout/_top_panel.scss 1.2 kB {0} [可选] [内置] [467] ./src/assets/scss/layout/_workspace.scss 1.2 kB {0} [可选] [内置] [468] ./src/assets/scss/main.scss 1.16 kB {0} [可选] [内置] [475] ./test/unit/index.js 505 字节 {0} [内置] + 461个隐藏模块./src/components/panel/RightPanelProperties.vue 中的警告 有多个模块的名称只是大小写不同。在使用其他大小写语义的文件系统上编译时,这可能会导致意外行为。使用相等的大小写。比较这些模块标识符: * /Users/rohmanhm/Desktop/Code/Works/unobuilder/node_modules/vue-loader/index.js??ref--1!/Users/rohmanhm/Desktop/Code/Works/unobuilder/node_modules/ eslint-loader/index.js??ref--0!/Users/rohmanhm/Desktop/Code/Works/unobuilder/src/components/panel/RightPanelProperties.vue 由 2 个模块使用,即 /Users/rohmanhm/桌面/代码/Works/unobuilder/src /^./(?!main(.js)?$)/ * /Users/rohmanhm/Desktop/Code/Works/unobuilder/node_modules/vue-loader/index.js?? ref--1!/Users/rohmanhm/Desktop/Code/Works/unobuilder/node_modules/eslint-loader/index.js??ref--0!
./src/components/panel/RightPanelSwitcher.vue 中的警告有多个模块的名称仅在大小写上有所不同。在使用其他大小写语义的文件系统上编译时,这可能会导致意外行为。使用相等的大小写。比较这些模块标识符: * /Users/rohmanhm/Desktop/Code/Works/unobuilder/node_modules/vue-loader/index.js??ref--1!/Users/rohmanhm/Desktop/Code/Works/unobuilder/node_modules/ eslint-loader/index.js??ref--0!/Users/rohmanhm/Desktop/Code/Works/unobuilder/src/components/panel/RightPanelSwitcher.vue 由2个模块使用,即/Users/rohmanhm/桌面/代码/Works/unobuilder/src /^./(?!main(.js)?$)/ * /Users/rohmanhm/Desktop/Code/Works/unobuilder/node_modules/vue-loader/index.js?? ref--1!/Users/rohmanhm/Desktop/Code/Works/unobuilder/node_modules/eslint-loader/index.js??ref--0!
./~/babel-loader/lib!./~/vue-loader/lib/selector.js?type=script&index=0!./src/components/panel/RightPanelProperties.vue 中的警告有多个模块的名称只是外壳不同。在使用其他大小写语义的文件系统上编译时,这可能会导致意外行为。使用相等的大小写。比较这些模块标识符: * /Users/rohmanhm/Desktop/Code/Works/unobuilder/node_modules/babel-loader/lib/index.js!/Users/rohmanhm/Desktop/Code/Works/unobuilder/node_modules/vue-loader/ lib/selector.js?type=script&index=0!/Users/rohmanhm/Desktop/Code/Works/unobuilder/src/components/panel/RightPanelProperties.vue 由 1 个模块使用,即 /Users/rohmanhm/Desktop/代码/Works/unobuilder/node_modules/vue-loader/index.js??ref--1!/Users/rohmanhm/Desktop/Code/Works/unobuilder/node_modules/eslint-loader/index. e. /Users/rohmanhm/Desktop/Code/Works/unobuilder/node_modules/vue-loader/index.js??ref--1!/Users/rohmanhm/Desktop/Code/Works/unobuilder/node_modules/eslint-loader/index. js??ref--0!/Users/rohmanhm/Desktop/Code/Works/unobuilder/src/components/panel/rightPanelProperties.vue e. /Users/rohmanhm/Desktop/Code/Works/unobuilder/node_modules/vue-loader/index.js??ref--1!/Users/rohmanhm/Desktop/Code/Works/unobuilder/node_modules/eslint-loader/index. js??ref--0!/Users/rohmanhm/Desktop/Code/Works/unobuilder/src/components/panel/rightPanelProperties.vue
./~/babel-loader/lib!./~/vue-loader/lib/selector.js?type=script&index=0!./src/components/panel/RightPanelSwitcher.vue 中的警告有多个模块的名称只是外壳不同。在使用其他大小写语义的文件系统上编译时,这可能会导致意外行为。使用相等的大小写。比较这些模块标识符: * /Users/rohmanhm/Desktop/Code/Works/unobuilder/node_modules/babel-loader/lib/index.js!/Users/rohmanhm/Desktop/Code/Works/unobuilder/node_modules/vue-loader/ lib/selector.js?type=script&index=0!/Users/rohmanhm/Desktop/Code/Works/unobuilder/src/components/panel/RightPanelSwitcher.vue 由 1 个模块使用,即 /Users/rohmanhm/Desktop/代码/Works/unobuilder/node_modules/vue-loader/index.js??ref--1!/Users/rohmanhm/Desktop/Code/Works/unobuilder/node_modules/eslint-loader/index.js??ref--0 !
./~/css-loader 中的错误?{"minimize":false,"sourceMap":false}!./~/sass-loader/lib/loader.js?{"sourceMap":false}!./src/ assets/scss/base.scss 模块构建失败:@include OpenSans;^ 没有名为 OpenSans 的 mixin
回溯:/Users/rohmanhm/Desktop/Code/Works/unobuilder/src/assets/scss/base/_fields.scss 中的 src/assets/scss/base/_fields.scss:22(第 22 行,第 16 列)@ ./ src/assets/scss/base.scss 4:14-148 @ ./src ^./(?!main(.js)?$) @ ./test/unit/index.js
./~/css-loader 中的错误?{"minimize":false,"sourceMap":false}!./~/sass-loader/lib/loader.js?{"sourceMap":false}!./src/ assets/scss/layout.scss 模块构建失败:背景颜色:变亮($warm-grey,20);^ 未定义变量:“$warm-grey”。在 /Users/rohmanhm/Desktop/Code/Works/unobuilder/src/assets/scss/layout/_base.scss(第 7 行,第 29 列)@ ./src/assets/scss/layout.scss 4:14-150 @ ./src ^./(?!main(.js)?$) @ ./test/unit/index.js
./~/css-loader 中的错误?{"minimize":false,"sourceMap":false}!./~/sass-loader/lib/loader.js?{"sourceMap":false}!./src/ assets/scss/base/_fields.scss 模块构建失败:[class*='#{$prefix}-fields-'] { ^ 未定义变量:“$prefix”。在 /Users/rohmanhm/Desktop/Code/Works/unobuilder/src/assets/scss/base/_fields.scss(第 1 行,第 12 列)@ ./src/assets/scss/base/_fields.scss 4:14- 157 @ ./src ^./(?!main(.js)?$) @ ./test/unit/index.js
./~/css-loader 中的错误?{"minimize":false,"sourceMap":false}!./~/sass-loader/lib/loader.js?{"sourceMap":false}!./src/ assets/scss/canvas/_elements.scss 模块构建失败:.#{$prefix}:not(.preview--mode) { ^ 未定义变量:“$prefix”。在 /Users/rohmanhm/Desktop/Code/Works/unobuilder/src/assets/scss/canvas/_elements.scss(第 1 行,第 4 列)@ ./src/assets/scss/canvas/_elements.scss 4:14- 159 @ ./src ^./(?!main(.js)?$) @ ./test/unit/index.js
./~/css-loader 中的错误?{"minimize":false,"sourceMap":false}!./~/sass-loader/lib/loader.js?{"sourceMap":false}!./src/ assets/scss/base/_fonts.scss 模块构建失败:src: url('#{$assets_path}/fonts/lato/lato100.eot'); /* IE9 兼容模式 */ ^ 未定义变量:“$assets-path”。在 /Users/rohmanhm/Desktop/Code/Works/unobuilder/src/assets/scss/base/_fonts.scss(第 6 行,第 52 列)@ ./src/assets/scss/base/_fonts.scss 4:14- 156 @ ./src ^./(?!main(.js)?$) @ ./test/unit/index.js
./~/css-loader 中的错误?{"minimize":false,"sourceMap":false}!./~/sass-loader/lib/loader.js?{"sourceMap":false}!./src/ assets/scss/layout/_accordion.scss 模块构建失败:.#{$prefix} { ^ 未定义变量:“$prefix”。在 /Users/rohmanhm/Desktop/Code/Works/unobuilder/src/assets/scss/layout/_accordion.scss(第 1 行,第 4 列)@ ./src/assets/scss/layout/_accordion.scss 4:14- 160 @ ./src ^./(?!main(.js)?$) @ ./test/unit/index.js
./~/css-loader 中的错误?{"minimize":false,"sourceMap":false}!./~/sass-loader/lib/loader.js?{"sourceMap":false}!./src/ assets/scss/layout/_canvas_tools.scss 模块构建失败:.#{$prefix} { ^ 未定义变量:“$prefix”。在 /Users/rohmanhm/Desktop/Code/Works/unobuilder/src/assets/scss/layout/_canvas_tools.scss(第 3 行,第 4 列)@ ./src/assets/scss/layout/_canvas_tools.scss 4:14- 163 @ ./src ^./(?!main(.js)?$) @ ./test/unit/index.js
./~/css-loader 中的错误?{"minimize":false,"sourceMap":false}!./~/sass-loader/lib/loader.js?{"sourceMap":false}!./src/ assets/scss/layout/_base.scss 模块构建失败:背景颜色:变亮($warm-grey,20);^ 未定义变量:“$warm-grey”。在 /Users/rohmanhm/Desktop/Code/Works/unobuilder/src/assets/scss/layout/_base.scss(第 7 行,第 29 列)@ ./src/assets/scss/layout/_base.scss 4:14- 155 @ ./src ^./(?!main(.js)?$) @ ./test/unit/index.js
./~/css-loader 中的错误?{"minimize":false,"sourceMap":false}!./~/sass-loader/lib/loader.js?{"sourceMap":false}!./src/ assets/scss/layout/_left_panel.scss 模块构建失败:.#{$prefix} { ^ 未定义变量:“$prefix”。在 /Users/rohmanhm/Desktop/Code/Works/unobuilder/src/assets/scss/layout/_left_panel.scss(第 1 行,第 4 列)@ ./src/assets/scss/layout/_left_panel.scss 4:14- 161 @ ./src ^./(?!main(.js)?$) @ ./test/unit/index.js
./~/css-loader 中的错误?{"minimize":false,"sourceMap":false}!./~/sass-loader/lib/loader.js?{"sourceMap":false}!./src/ assets/scss/layout/_properties.scss 模块构建失败:.#{$prefix} { ^ 未定义变量:“$prefix”。在 /Users/rohmanhm/Desktop/Code/Works/unobuilder/src/assets/scss/layout/_properties.scss(第 1 行,第 4 列)@ ./src/assets/scss/layout/_properties.scss 4:14- 161 @ ./src ^./(?!main(.js)?$) @ ./test/unit/index.js
./~/css-loader 中的错误?{"minimize":false,"sourceMap":false}!./~/sass-loader/lib/loader.js?{"sourceMap":false}!./src/ assets/scss/layout/_right_panel.scss 模块构建失败:.#{$prefix} { ^ 未定义变量:“$prefix”。在 /Users/rohmanhm/Desktop/Code/Works/unobuilder/src/assets/scss/layout/_right_panel.scss(第 1 行,第 4 列)@ ./src/assets/scss/layout/_right_panel.scss 4:14- 162 @ ./src ^./(?!main(.js)?$) @ ./test/unit/index.js
./~/css-loader 中的错误?{"minimize":false,"sourceMap":false}!./~/sass-loader/lib/loader.js?{"sourceMap":false}!./src/ assets/scss/layout/_screen_tools.scss 模块构建失败:.#{$prefix} { ^ 未定义变量:“$prefix”。在 /Users/rohmanhm/Desktop/Code/Works/unobuilder/src/assets/scss/layout/_screen_tools.scss(第 1 行,第 4 列)@ ./src/assets/scss/layout/_screen_tools.scss 4:14- 163 @ ./src ^./(?!main(.js)?$) @ ./test/unit/index.js
./~/css-loader 中的错误?{"minimize":false,"sourceMap":false}!./~/sass-loader/lib/loader.js?{"sourceMap":false}!./src/ assets/scss/layout/_top_panel.scss 模块构建失败:.#{$prefix} { ^ 未定义变量:“$prefix”。在 /Users/rohmanhm/Desktop/Code/Works/unobuilder/src/assets/scss/layout/_top_panel.scss(第 1 行,第 4 列)@ ./src/assets/scss/layout/_top_panel.scss 4:14- 160 @ ./src ^./(?!main(.js)?$) @ ./test/unit/index.js
./~/css-loader 中的错误?{"minimize":false,"sourceMap":false}!./~/sass-loader/lib/loader.js?{"sourceMap":false}!./src/ assets/scss/layout/_workspace.scss 模块构建失败:.#{$prefix} { ^ 未定义变量:“$prefix”。在 /Users/rohmanhm/Desktop/Code/Works/unobuilder/src/assets/scss/layout/_workspace.scss(第 1 行,第 4 列)@ ./src/assets/scss/layout/_workspace.scss 4:14- 160 @ ./src ^./(?!main(.js)?$) @ ./test/unit/index.js 02 03 2017 16:16:01.321:INFO [karma]:Karma v1.5.0 服务器开始于 http://0.0.0.0:9876/2017 年 2 月 3 日 16:16:01.328:INFO [启动器]:以无限并发启动浏览器 PhantomJS 02 03 2017 16:16:01.510:INFO [启动器]:启动浏览器 PhantomJS 02 03 2017 16:16:09.946:INFO [PhantomJS 2.1 .1 (Mac OS X 0.0.0)]: 连接到套接字 iTpEd0seJoQ2f3fcAAAA 与 id 5748459 02 03 2017 16:16:19.949:WARN [PhantomJS 2.1.1 (Mac OS X 0.0.0)]: 断开连接 (1 次),因为在 10000 毫秒内没有消息。PhantomJS 2.1.1 (Mac OS X 0.0.0) 错误断开连接,因为 10000 毫秒内没有消息。
PhantomJS 2.1.1 (Mac OS X 0.0.0):执行 0 of 0 DISCONNECTED (10.013 secs / 0 secs)
错误命令失败,退出代码为 1。
请帮我解决这个问题。谢谢。