Vol*_*hat 5 typescript protractor visual-studio-code angular
我在打字稿中有 e2e 测试的 angular 应用程序,我想在 VSCode 中运行调试。我去read.me看看如何运行调试,这很容易。但我的问题是打字稿测试中的断点并没有停止。正如我所见,我有未生成的源映射问题。
配置文件
{
"compileOnSave": true,
"compilerOptions": {
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"target": "es5",
"typeRoots": [
"../node_modules/@types"
]
}
}
Run Code Online (Sandbox Code Playgroud)
启动文件
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/node_modules/protractor/bin/protractor",
"stopOnEntry": false,
"sourceMaps": true,
"cwd": "${workspaceRoot}",
"args": [
"${workspaceRoot}/protractor.conf.js"
]
}
]
}
Run Code Online (Sandbox Code Playgroud)
量角器配置文件
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/docs/referenceConf.js
/*global jasmine */
var SpecReporter = require('jasmine-spec-reporter');
exports.config = {
allScriptsTimeout: 11000,
specs: [
'./e2e/**/*.e2e-spec.ts'
],
capabilities: {
'browserName': 'chrome'
},
directConnect: true,
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
print: function() {}
},
useAllAngular2AppRoots: true,
beforeLaunch: function() {
require('ts-node').register({
project: 'e2e'
});
},
onPrepare: function() {
jasmine.getEnv().addReporter(new SpecReporter());
}
};
Run Code Online (Sandbox Code Playgroud)
据我了解,ts-node 正在将 ts 编译为 js,并且可能不是生成源映射,或者它们存储在某个特定位置
我做错了什么?
看起来 Protractor 正在调用source-map-support自身,这会覆盖发出的调用ts-node。
尝试在 protractor.conf.js 中启用该skipSourceMapSupport选项。
| 归档时间: |
|
| 查看次数: |
1976 次 |
| 最近记录: |