Results 1 to 5 of 5

Thread: Sencha Touch and TDD

  1. #1
    Sencha User
    Join Date
    Aug 2011
    Posts
    5

    Default Sencha Touch and TDD

    Hi,

    i'm trying to build an app with sencha touch by following the principles of test driven development. i'm wondering if there is a best practice to do so. I tried to use jsunit but i got problems with testing controllers of my mvc app.
    Anyone tried this so far? I didn't find much in previous posts.

    Thanks in advance.
    Mat

  2. #2

    Default

    I would like to know a best practice, too.
    Today I'm using jasmine for testing some util JS-files but I haven't tried to test a whole sencha touch app. But this should also be possible...

  3. #3
    Sencha User
    Join Date
    Aug 2011
    Posts
    5

    Default

    hi,
    thank you for your response, heringsfilet!
    Testing util js files is no problem but I can't figure out how to test my sencha touch mvc app components. For example the controllers or stores which are created within the application and seem to work only there...

  4. #4

    Default

    In jasmine you need to add all files to test (of course). So you need to add your whole application and then write a test for the part you want to test.
    This should work if you only use local data. But then you need to ensure that the localStorage is empty before testing the app. If you use remote data, it's hard to write unit-tests as it could be that the connection couldn't be established or something like that.

    But I am not used to testing javascript applications, so I don't know if this would work.

  5. #5
    Sencha User
    Join Date
    Jul 2010
    Location
    Switzerland
    Posts
    78

    Default

    jasmine allows you to return mock responses for ajax calls, so there is no need to make the actual call.
    I don't have an example ready, but the docs are sure to have a nice one

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •