【问题标题】:`beforeEach` Behavior with Nested Tests in Intern实习生中嵌套测试的“beforeEach”行为
【发布时间】:2013-08-08 22:08:57
【问题描述】:

只是想知道当您在实习生中使用object 接口进行嵌套功能测试时beforeEach 是如何工作的。例如

registerSuite({
    name: 'Before Each Test Suite',
    beforeEach: function () {
        // parent beforeEach
    },
    'test one': function () {},
    'inner suite': {
        beforeEach: function () {
            // nested beforeEach
        },
        'test two': function () {},
        'test three': function () {}
    }
});

在这种情况下,我希望父 beforeEach 被调用 3 次(每个测试一次),嵌套的 beforeEach 被调用两次。但是,在我的测试中,父 beforeEach 似乎只被调用了两次。 test one 一次,inner suite 仅一次。我错过了什么还是这是预期的行为?

【问题讨论】:

    标签: javascript testing intern


    【解决方案1】:

    这是预期的行为,但它会在未来发生变化,因为似乎没有其他人预料到它。见:https://github.com/theintern/intern/issues/67

    【讨论】:

      猜你喜欢
      • 2016-02-11
      • 1970-01-01
      • 1970-01-01
      • 2015-10-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多