Tag: spectron

为什么这些柴testing不会失败?

我们有一个简单的“这是真正的工作”使用Spectron和WebdriverIO一个电子应用程序的柴testing。 我们开始的示例代码是从 https://github.com/jwood803/ElectronSpectronDemo报告在https://github.com/jwood803/ElectronSpectronDemo/issues/2中 ,chai-as-promisedtesting不捕获不匹配,所以我想我会添加一些额外的testing,以找出为什么柴是不是失败的testing电子应用程序的文本不符合预期的unit testing文本。 让我们从简单的东西开始,其余的代码在https://github.com/drjasonharrison/ElectronSpectronDemo describe('Test Example', function () { beforeEach(function (done) { app.start().then(function() { done(); } ); }); afterEach(function (done) { app.stop().then(function() { done(); }); }); it('yes == no should fail', function () { chai.expect("yes").to.equal("no"); }); it('yes == yes should succeed', function () { chai.expect("yes").to.equal("yes"); }); 第一次unit testing失败,第二次成功。 而当我们把这个断言放到一个函数中时,它仍能检测到这个失败: it('should fail, but succeeds!?', […]