Git版本: 2.13.0.windows.1
操作系统: Windows 7
CLI: Git bash
的.gitconfig
[user]
name = Gyandeep Singh
email = private@email.com
[push]
default = current
[core]
autocrlf = input
[includeIf "gitdir: ~/Documents/webstorm/corporate/"]
path = .gitconfig-work
Run Code Online (Sandbox Code Playgroud)
的.gitconfig工作
[user]
name = Gyandeep Singh
email = corporate@email.com
Run Code Online (Sandbox Code Playgroud)
发生了什么:在公司文件夹内的文件夹(示例测试)上打开CLI,然后运行git config user.email
输出private@email.com
.
预期:结果应该是corporate@email.com
.
我做错了什么或者我的期望不正确吗?我确实遵循了git文档.
你必须git config --show-origin --get user.email
在git初始化目录上运行.如果它没有初始化git那么includeIf gitdir
功能将不起作用.
它奇怪但真实.我希望它仍然奏效.
我怎样才能解决我的.ts
文件,每次我保存在一个文件WebStorm?
我知道我可以tslint --fix
在保存后跑步.我也知道我可以⌥⏎+ ⏎在文件中的当前错误,并将解决该错误.但我已经习惯了不同的样式指南,它可以节省我很多时间来自动修复这些样式lint错误:
我在WebStorm中找不到相关设置:
我也完全愿意使用不同的cli工具来实现保存时的自动创作.
所以基本上我有一个函数,仅当参数等于某个值时我才想对其行为进行存根。例子
var sinon = require('sinon');
var foo = {
bar: function(arg1){
return true;
}
};
var barStub = sinon.stub(foo, "bar");
barStub.withArgs("test").returns("Hi");
// Expectations
console.log(foo.bar("test")); //works great as it logs "Hi"
// my expectation is to call the original function in all cases except
// when the arg is "test"
console.log(foo.bar("woo")); //doesnt work as it logs undefined
Run Code Online (Sandbox Code Playgroud)
git ×1
git-bash ×1
javascript ×1
mocking ×1
node.js ×1
sinon ×1
tslint ×1
typescript ×1
webstorm ×1
windows ×1