在gitk中有两个面板,顶部面板主要显示提交列表,底部面板显示此提交中的更改.不知怎的,从本周开始,我无法调整这两个面板的高度,比如让它们中的一个更大/更小.知道为什么吗?
我有使用supertest和mocha的代码:
import request from 'supertest';
//....
var newGame;
describe('Creating game', function() {
beforeEach(function(done) {
request(app)
.post('/api/games')
.send({
owner: 'Mr. X',
})
.expect(201)
.expect('Content-Type', /json/)
.end((err, res) => {
if (err) {
return done(err);
}
newGame = res.body;
done();
});
});
describe('the created game', function() {
it('should name the specified owner', function() {
newGame.owner.should.equal('Mr. X');
});
...
})
});
Run Code Online (Sandbox Code Playgroud)
当服务器代码抛出一些异常(例如访问未定义对象的属性)时,我得到了这个堆栈跟踪
Error: expected 201 "Created", got 500 "Internal Server Error"
at Test._assertStatus (D:\Codes\theApp\node_modules\supertest\lib\test.js:232:12)
at Test._assertFunction (D:\Codes\theApp\node_modules\supertest\lib\test.js:247:11)
at Test.assert (D:\Codes\theApp\node_modules\supertest\lib\test.js:148:18)
at Server.assert (D:\Codes\theApp\node_modules\supertest\lib\test.js:127:12) …
Run Code Online (Sandbox Code Playgroud) 我根据这个问题中的代码采用了并行/消费者的实现
class ParallelConsumer<T> : IDisposable
{
private readonly int _maxParallel;
private readonly Action<T> _action;
private readonly TaskFactory _factory = new TaskFactory();
private CancellationTokenSource _tokenSource;
private readonly BlockingCollection<T> _entries = new BlockingCollection<T>();
private Task _task;
public ParallelConsumer(int maxParallel, Action<T> action)
{
_maxParallel = maxParallel;
_action = action;
}
public void Start()
{
try
{
_tokenSource = new CancellationTokenSource();
_task = _factory.StartNew(
() =>
{
Parallel.ForEach(
_entries.GetConsumingEnumerable(),
new ParallelOptions { MaxDegreeOfParallelism = _maxParallel, CancellationToken = _tokenSource.Token },
(item, loopState) => …
Run Code Online (Sandbox Code Playgroud) 我在配置文件中看到了用于量角器的这种模式.
specs: [
'test/e2e/**/*.spec.js'
]
Run Code Online (Sandbox Code Playgroud)
意思是它意味着" test/e2e中的所有文件".这是什么样的模式?我认为这不是正则表达式,因为那些未转义的斜杠.特别是,为什么**
在中间,而不仅仅是test/e2e/*.spec.js
?
我尝试使用搜索引擎,但没有找到任何有用的可能因为星号在搜索引擎中不能很好地工作.
在javascript中,假设我有这个:
var foo = { a: true, b: false, c: true };
Run Code Online (Sandbox Code Playgroud)
如何获取其值为true的所有名称?在上面的例子中,这段代码将返回['a', 'c']
javascript ×2
node.js ×2
.net ×1
c# ×1
filepath ×1
git ×1
gitk ×1
mocha.js ×1
protractor ×1
supertest ×1