我已经下载了一个种子项目Angular2 Webpack Starter,并在没有问题的情况下启动并运行.我遇到的一个不便是在单元测试下调试源文件.所有*.spec.ts
文件都加载到浏览器中并可调试,因此map
至少为它们生成文件.当我进入测试的源文件时,我得到这样的东西:
业力配置:
module.exports = function(config) {
var testWebpackConfig = require('./webpack.test.js');
config.set({
basePath: '',
frameworks: ['jasmine'],
exclude: [ ],
files: [ { pattern: './config/spec-bundle.js', watched: false } ],
preprocessors: { './config/spec-bundle.js': ['coverage', 'webpack', 'sourcemap'] },
webpack: testWebpackConfig,
coverageReporter: {
dir : 'coverage/',
reporters: [
{ type: 'text-summary' },
{ type: 'json' },
{ type: 'html' }
]
},
webpackServer: { noInfo: true },
reporters: [ 'mocha', 'coverage' ],
port: 9876,
colors: true,
logLevel: …
Run Code Online (Sandbox Code Playgroud) 通常我会以这种方式创建一个表达式.
ParameterExpression pe = Expression.Parameter(typeof(object1), "x");
string Name = "property1";
MemberExpression left = Expression.Property(pe, (object1).GetProperty(Name));
Run Code Online (Sandbox Code Playgroud)
它产生 left = x => x.property1
我需要知道我该如何制作
left = x => x.Object2.property1
如果Name ="Object2.property1"; 和object2是object1的子项
提前致谢
考虑以下计划:
var path = Path.Combine(
Path.GetTempPath(),
Path.GetFileNameWithoutExtension(Path.GetRandomFileName()));
Directory.CreateDirectory(path);
var testFile = Path.Combine(path, "test.txt");
File.WriteAllText(testFile, "Test file");
var source = Repository.Init(path);
using (var repository = new Repository(source))
{
repository.Index.Add("test.txt");
}
Directory.Delete(path, true);
Run Code Online (Sandbox Code Playgroud)
在删除存储库文件夹时,我得到了UnauthorizedAccessException
- 拒绝访问其中一个内部git文件.为了删除文件夹,还有什么我应该处理的吗?
我遇到过像这样的设置代码:
internal class Something
{
public string Name { get; set; }
public override string ToString()
{
return Name;
}
}
internal static class Factory
{
public static string Name { get; set; }
public static Something Create()
{
return new Something { Name = Name };
}
}
internal static class Resources
{
public static readonly Something DefaultSomething = Factory.Create();
}
internal class Program
{
public static void Main(string[] args)
{
Factory.Name = "MyFactory";
Execute();
Console.ReadKey();
}
private static …
Run Code Online (Sandbox Code Playgroud) c# ×3
.net-4.0 ×1
angular ×1
expression ×1
func ×1
git ×1
javascript ×1
karma-runner ×1
libgit2sharp ×1
linq ×1
static ×1
typescript ×1
webpack ×1