gpt4 book ai didi

javascript - yeoman gulp-angular projekt 设置后单元测试出错

转载 作者:数据小太阳 更新时间:2023-10-29 03:56:12 25 4
gpt4 key购买 nike

...

设置有问题。

我使用 yeoman 并使用

创建我的项目
yo gup-angular

设置完成后我开始单元测试

gulp test

但它失败了:

PS P:\projects\test-logbook> gulp test
[15:15:14] Using gulpfile P:\projects\mydisk-logbook\gulpfile.js
[15:15:14] Starting 'scripts'...
[15:15:15] all files 14.08 kB
[15:15:15] Finished 'scripts' after 840 ms
[15:15:15] Starting 'test'...
28 09 2017 15:15:15.601:WARN [proxy]: proxy "\base\src\assets\" normalized to "\base\src\assets\/"
28 09 2017 15:15:15.665:WARN [watcher]: Pattern "P:/projects/mydisk-logbook/src/**/*.mock.js" does not match any file.
PhantomJS 1.9.8 (Windows 8 0.0.0) ERROR
TypeError: 'undefined' is not a function (near '....info({ angularVersion: '...')
at P:/projects/mydisk-logbook/bower_components/angular-animate/angular-animate.js:4138


[15:15:18] 'test' errored after 2.69 s
[15:15:18] Error: Failed 1 tests.
at P:\projects\mydisk-logbook\gulp\unit-tests.js:41:22
at removeAllListeners (P:\projects\mydisk-logbook\node_modules\karma\lib\server.js:336:7)
at Server.<anonymous> (P:\projects\mydisk-logbook\node_modules\karma\lib\server.js:347:9)
at Server.g (events.js:292:16)
at emitNone (events.js:91:20)
at Server.emit (events.js:185:7)
at emitCloseNT (net.js:1554:8)
at _combinedTickCallback (internal/process/next_tick.js:77:11)
at process._tickCallback (internal/process/next_tick.js:104:9)

它在 bower_components/angular-animate/angular-animate.js 中失败,第 4138 行。

如何解决该错误?我的失败是什么?

问候n00n

ps:Bower Update 为我提供了这些信息

Please note that,
angular-aria#1.5.11, angular-cookies#1.5.11, angular-messages#1.5.11, angular-mocks#1.5.11, angular-resource#1.5.11, angular-sanitize#1.5.11, angular-touch#1.5.11 depends on angular#1.5.11 which resolved to angular#1.5.11
mydisk-logbook depends on angular#~1.5.3 which resolved to angular#1.5.11
angular-material#1.0.9 depends on angular#^1.4.8 which resolved to angular#1.5.11
angular-ui-router#0.2.18 depends on angular#^1.0.8 which resolved to angular#1.5.11
angular-toastr#1.5.0 depends on angular#>=1.3.0 which resolved to angular#1.5.11
angular-animate#1.6.6 depends on angular#1.6.6 which resolved to angular#1.6.6
Resort to using angular#~1.5.3 which resolved to angular#1.5.11
Code incompatibilities may occur.

bower jquery extra-resolution Unnecessary resolution: jquery#~2.1.4

最佳答案

这类问题通常是由于 Angular 库之间的版本不匹配造成的。Angular 的所有库都锁定到同一版本吗?

关于javascript - yeoman gulp-angular projekt 设置后单元测试出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46470265/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com