Node.js 量角器在Visual Studio代码中不显示堆栈跟踪

Node.js 量角器在Visual Studio代码中不显示堆栈跟踪,node.js,npm,visual-studio-code,jasmine,protractor,Node.js,Npm,Visual Studio Code,Jasmine,Protractor,我对量角器和VisualStudio代码一无所知。我已经尝试在stackoverflow和google上寻找解决方案,但没有成功 基本上,我是通过visual studio代码中的量角器运行e2e测试,并使用一个终端命令,例如“npm run e2e:local”,它运行“export ENVIRONMENT=local&&dragrator./e2e/dragrator.conf.js” 测试运行良好,除了失败时没有任何类型的堆栈跟踪,所以我不知道如何/在哪里查找代码中的错误。 以下是测试运行

我对量角器和VisualStudio代码一无所知。我已经尝试在stackoverflow和google上寻找解决方案,但没有成功

基本上,我是通过visual studio代码中的量角器运行e2e测试,并使用一个终端命令,例如“npm run e2e:local”,它运行“export ENVIRONMENT=local&&dragrator./e2e/dragrator.conf.js”

测试运行良好,除了失败时没有任何类型的堆栈跟踪,所以我不知道如何/在哪里查找代码中的错误。 以下是测试运行的示例输出:

[16:55:47] I/direct - Using ChromeDriver directly...
Jasmine started

  Construction NZ Level 50 user
    ✗ Can create a project with all fields filled in and with a contractor
      - Failed: Invalid locator

**************************************************
*                    Failures                    *
**************************************************

1) Construction NZ Level 50 user Can create a project with all fields filled in and with a contractor
  - Failed: Invalid locator

Executed 1 of 3 specs (1 FAILED) (2 SKIPPED) in 31 secs.
[16:56:22] I/launcher - 0 instance(s) of WebDriver still running
[16:56:22] I/launcher - chromeANY #01 failed 1 test(s)
[16:56:22] I/launcher - overall: 1 failed spec(s)
[16:56:22] E/launcher - Process exited with error code 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! HazardCoHub@1.3.10 e2e:local: `export ENVIRONMENT=local && protractor ./e2e/protractor.conf.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the HazardCoHub@1.3.10 e2e:local script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/dmitrikoudrin/.npm/_logs/2020-08-27T04_56_22_187Z-debug.log```

So as you can see it just says "Failed: Invalid locator" which is of no help to me as it could be any one of a 100 locators in the code.
All I want is for it give a standard stack trace and point me to the function that's failing. It would be even better if it could print what locator it tried to find/use before failing.


Full log:
0 info it worked if it ends with ok
1 verbose cli [ '/Users/dmitrikoudrin/.nvm/versions/node/v10.16.3/bin/node',
1 verbose cli   '/Users/dmitrikoudrin/.nvm/versions/node/v10.16.3/bin/npm',
1 verbose cli   'run',
1 verbose cli   'e2e:local' ]
2 info using npm@6.9.0
3 info using node@v10.16.3
4 verbose run-script [ 'pree2e:local', 'e2e:local', 'poste2e:local' ]
5 info lifecycle HazardCoHub@1.3.11~pree2e:local: HazardCoHub@1.3.11
6 info lifecycle HazardCoHub@1.3.11~e2e:local: HazardCoHub@1.3.11
7 verbose lifecycle HazardCoHub@1.3.11~e2e:local: unsafe-perm in lifecycle true
8 verbose lifecycle HazardCoHub@1.3.11~e2e:local: PATH: /Users/dmitrikoudrin/.nvm/versions/node/v10.16.3/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/dmitrikoudrin/hazardco_hub_2/node_modules/.bin:/Users/dmitrikoudrin/Library/Android/sdk/tools:/Users/dmitrikoudrin/Library/Android/sdk/build-tools:/Users/dmitrikoudrin/.nvm/versions/node/v10.16.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/dmitrikoudrin/Library/Android/sdk/tools:/Users/dmitrikoudrin/Library/Android/sdk/build-tools:/Users/dmitrikoudrin/.nvm/versions/node/v10.16.3/bin
9 verbose lifecycle HazardCoHub@1.3.11~e2e:local: CWD: /Users/dmitrikoudrin/hazardco_hub_2
10 silly lifecycle HazardCoHub@1.3.11~e2e:local: Args: [ '-c',
10 silly lifecycle   'export ENVIRONMENT=local && protractor ./e2e/protractor.conf.js' ]
11 silly lifecycle HazardCoHub@1.3.11~e2e:local: Returned: code: 1  signal: null
12 info lifecycle HazardCoHub@1.3.11~e2e:local: Failed to exec e2e:local script
13 verbose stack Error: HazardCoHub@1.3.11 e2e:local: `export ENVIRONMENT=local && protractor ./e2e/protractor.conf.js`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/Users/dmitrikoudrin/.nvm/versions/node/v10.16.3/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack     at EventEmitter.emit (events.js:198:13)
13 verbose stack     at ChildProcess.<anonymous> (/Users/dmitrikoudrin/.nvm/versions/node/v10.16.3/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:198:13)
13 verbose stack     at maybeClose (internal/child_process.js:982:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid HazardCoHub@1.3.11
15 verbose cwd /Users/dmitrikoudrin/hazardco_hub_2
16 verbose Darwin 19.6.0
17 verbose argv "/Users/dmitrikoudrin/.nvm/versions/node/v10.16.3/bin/node" "/Users/dmitrikoudrin/.nvm/versions/node/v10.16.3/bin/npm" "run" "e2e:local"
18 verbose node v10.16.3
19 verbose npm  v6.9.0
20 error code ELIFECYCLE
21 error errno 1
22 error HazardCoHub@1.3.11 e2e:local: `export ENVIRONMENT=local && protractor ./e2e/protractor.conf.js`
22 error Exit status 1
23 error Failed at the HazardCoHub@1.3.11 e2e:local script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
[16:55:47]I/direct-直接使用ChromeDriver。。。
茉莉开始
新西兰建筑50级用户
✗ 可以创建一个包含所有字段的项目,也可以创建一个包含承包商的项目
-失败:无效的定位器
**************************************************
*失败*
**************************************************
1) 施工新西兰50级用户可以创建一个项目,填写所有字段,并与承包商合作
-失败:无效的定位器
在31秒内执行了3个规格中的1个(1个失败)(2个跳过)。
[16:56:22]I/launcher-WebDriver的0个实例仍在运行
[16:56:22]I/launcher-chromeANY#01未通过1次测试
[16:56:22]I/启动器-总体:1个规范失败
[16:56:22]E/launcher-进程已退出,错误代码为1
npm错误!代码失效循环
npm错误!错误1
npm错误!HazardCoHub@1.3.10e2e:local:`export ENVIRONMENT=local&&dragrator./e2e/dragrator.conf.js`
npm错误!退出状态1
npm错误!
npm错误!失败HazardCoHub@1.3.10e2e:本地脚本。
npm错误!这可能不是npm的问题。上面可能还有其他日志输出。
npm错误!此运行的完整日志可在以下位置找到:
npm错误/Users/dmitrikoudrin/.npm/_logs/2020-08-27T04_56_22_187Z-debug.log```
正如你所看到的,它只是说“失败:无效定位器”,这对我没有帮助,因为它可能是代码中100个定位器中的任何一个。
我所需要的就是为它提供一个标准的堆栈跟踪,并指向失败的函数。如果它能打印出失败前试图查找/使用的定位器,那就更好了。
完整日志:
0信息如果以“确定”结尾,则有效
1 verbose cli['/Users/dmitrikoudrin/.nvm/versions/node/v10.16.3/bin/node',
1 verbose cli'/Users/dmitrikoudrin/.nvm/versions/node/v10.16.3/bin/npm',
1详细cli“运行”,
1详细cli“e2e:本地”]
2信息使用npm@6.9.0
3信息使用node@v10.16.3
4详细运行脚本['pree2e:local','e2e:local','poste2e:local']
5信息生命周期HazardCoHub@1.3.11~2e:本地:HazardCoHub@1.3.11
6信息生命周期HazardCoHub@1.3.11~e2e:本地:HazardCoHub@1.3.11
7详细的生命周期HazardCoHub@1.3.11~e2e:本地:生命周期中的不安全烫发为true
8详细的生命周期HazardCoHub@1.3.11~e2e:local:PATH:/Users/dmitrikoudrin/.nvm/versions/node/v10.16.3/lib/node\u modules/npm/node\u modules/npm lifecycle/node-gyp-bin:/Users/dmitrikoudrin/hazardco\u-hub\u-2/node\u-modules/.bin:/Users/dmitrikoudrin/Library/Android/Android/sdk/sdk/build-tools:/Users/Users/Users/Users/dmitrikoudrin/versions/node/v10.16.3/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/dmitrikoudrin/Library/Android/sdk/build tools:/Users/dmitrikoudrin/.nvm/Versions/node/v10.16.3/bin
9详细的生命周期HazardCoHub@1.3.11~e2e:local:CWD:/Users/dmitrikoudrin/hazardco\u hub\u 2
10愚蠢的生命周期HazardCoHub@1.3.11~e2e:local:Args:['-c',,
10“导出环境=本地和量角器。/e2e/dragrator.conf.js']
11愚蠢的生命周期HazardCoHub@1.3.11~e2e:本地:返回:代码:1信号:null
12信息生命周期HazardCoHub@1.3.11~e2e:local:无法执行e2e:local脚本
13详细堆栈错误:HazardCoHub@1.3.11e2e:local:`export ENVIRONMENT=local&&dragrator./e2e/dragrator.conf.js`
13详细堆栈退出状态1
13 EventEmitter上的详细堆栈。(/Users/dmitrikoudrin/.nvm/versions/node/v10.16.3/lib/node_modules/npm/node_modules/npm lifecycle/index.js:301:16)
13 EventEmitter.emit上的详细堆栈(events.js:198:13)
13子进程上的详细堆栈。(/Users/dmitrikoudrin/.nvm/versions/node/v10.16.3/lib/node_modules/npm/node_modules/npm lifecycle/lib/spawn.js:55:14)
13 ChildProcess.emit上的详细堆栈(events.js:198:13)
13 maybeClose的详细堆栈(internal/child_process.js:982:16)
13 Process.ChildProcess.\u handle.onexit处的详细堆栈(internal/child\u Process.js:259:5)
14详细的pkgidHazardCoHub@1.3.11
15详细的cwd/Users/dmitrikoudrin/hazardco_hub_2
16详细达尔文19.6.0
17详细argv“/Users/dmitrikoudrin/.nvm/versions/node/v10.16.3/bin/node”“/Users/dmitrikoudrin/.nvm/versions/node/v10.16.3/bin/npm”“运行”“e2e:local”
18详细节点v10.16.3
19详细的npm v6.9.0
20错误代码ELIFECYCLE
21错误1
22错误HazardCoHub@1.3.11e2e:local:`export ENVIRONMENT=local&&dragrator./e2e/dragrator.conf.js`
22错误退出状态1
23发生错误时失败HazardCoHub@1.3.11e2e:本地脚本。
23错误这可能不是npm的问题。上面可能还有其他日志输出。
24详细退出[1,true]

确保您的配置

    jasmineNodeOpts: {

        // If true, display spec names.
        isVerbose: true,

        // If true, print colors to the terminal.
        showColors: true,

        // If true, include stack traces in failures.
        includeStackTrace: true,

    },

欢迎来到stackoverflow。您还可以发布/Users/dmitrikoudrin/.npm/_logs/2020-08-27T04_56_22_187Z-debug.log中提供的完整运行的内容吗?这有帮助吗?没有,我已经有了@Sergey@AwSnap把它添加到帖子里。请问你在说什么配置?因为有很多配置文件。。。有一个dragrator.conf.js、一个tsconfig.json、一个dragrator.conf-dev.js、一个config-local.json、一个launch.json等等。在dragrator中指定了
jasmineNodeOpts
的地方查找