Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A Application-ready mechanism #13

Open
ElectricMaxxx opened this issue Apr 15, 2013 · 1 comment
Open

A Application-ready mechanism #13

ElectricMaxxx opened this issue Apr 15, 2013 · 1 comment

Comments

@ElectricMaxxx
Copy link
Owner

In my work with the DOM Testing a get an other issue with testing applications in this testing framework:

if I init my application for example by this:

  setup(function(){
   var Option = {container:"Filebrowser"}; 
   FB.init(Option);
  });

(it a mocha notification for tdd)
Igot the problem, that the application isnt ready. This means all HTML stuff that will be loaded by the application isnt available, allthoug i started testing after loading the complete HTML stuff. This isnt the a problem of document.readyState. This is a problem of the differnt loading-times of the application itself.

I solved this by using a ready event inside of the application and it works:

    test("Default Container with id=FB created",function(){
      FB.ready(function(){
        assert.that("",has.tag("Filebrowser"));
      });
    });

But is that a good way of testing? Could we get these things into the testing framework, maybe by settings?

Otherwise i can set some timeout with mocha, but this isn`t a good way to, I think.
Nobody could tell me, when the application is completly ready with thier dom building stuff.

@ElectricMaxxx
Copy link
Owner Author

This is more a discussion of cool testing, what means: use setup/teardown (tdd in mocha).

If you want it dirty, you can init your Application before you start your testing stuff. But then you lost your chance of testing differnt option situation (for example) and you have to change your testing Stituation over and over. This is not that, what i want for a dom testing system.

I will add some examples with the application ready (compromise).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant