That's not how it works.



  • Set a karma bag in the webstorm. Doing http://youtube.com/watch?v=QQSySPpzmPI ♪

    But the next problem arose.

    /**
    * Created by Maks on 15.01.2016.
    */
    var HelloWorld = function(World) {
    console.log("Hello, World" + " " + World + "!");
    }
    

    HelloWorld("");
    HelloWorld("abcd");

    This is the basic code contained in the project sub-pack called js/

    This is part of the configuration that went to karma.conf.js:

    // list of files / patterns to load in the browser
    files: ['js/.js','tests/.js'
    ],

    // list of files to exclude
    exclude: ['js/dontTestIt.js'
    ],

    Here's the test validate_test.js from the tests:

    /**

    • Created by Maks on 15.01.2016.
      */
      describe("The name validator", function(){
      describe("Checks for empty string", function(){
      it("should return true when the string is empty",function(){
      expect(HelloWorld("")).toBe(true);
      });
      it("should return false when the string is not empty",function(){
      expect(HelloWorld("abcd")).toBe(false);
      });
      });
      });

    The current starts, but it's a mistake:

    введите сюда описание изображения

    введите сюда описание изображения

    How do we solve this problem?



  • In fact, the test is not correct. Hello World doesn't bring anything back, 'cause it doesn't seem like it's coming back. undefinedas noted in the comments. As a decision, two ways are:

    1. Rewrite the above-mentioned test
    2. rewrite the code to enable it to report on the state of performance

    And the second option, I think, is preferable.


Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2