zoukankan      html  css  js  c++  java
  • Some usefule jasmine terms and its wiki pages

    1 Suites and specs

     

    1.1 Specs

    Each spec is, naturally, a JavaScript function. You tell Jasmine about a spec with a call to it() with a description string and the function. The string is a description of a behavior that you want your production code to exhibit; it should be meaningful to you when reading a report.

    it('should increment a variable', function () {
      var foo = 0;
      foo++;
    });
    

    1.2 Suites

    Specs are grouped in Suites. Suites are defined using the global describe() function:

    describe('Calculator', function () {
      it('can add a number', function () {
      ...
      });
    
      it('can multiply some numbers', function () {
      ...
      });
    });
    

    1.3 Disabling Tests & Suites

    Specs may be disabled by calling xit() instead of it(). Suites may be disabled by calling xdescribe() instead of describe().

    2 Matchers

    Jasmine has several built-in matchers. Here are a few:

    3 Spies

    Jasmine integrates 'spies' that permit many spying, mocking, and faking behaviors. A 'spy' replaces the function it is spying on.

    4 Before and After

    A suite can have a beforeEach() declaration. It takes a function that is run before each spec.


    Post by: Jalen Wang (转载请注明出处)

  • 相关阅读:
    Add a column in table control
    ALV
    ABAP Object Differences
    Field Symbols, Casting Decimal Places
    fROM PPV report
    python全局变量
    管理商品demo
    Mac系统在Pycharm中切换解释器
    python中 元组
    python中字符串格式化
  • 原文地址:https://www.cnblogs.com/jalenwang/p/2382625.html
Copyright © 2011-2022 走看看