incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jesse MacFadyen (JIRA)" <>
Subject [jira] [Commented] (CB-671) Tests should be described in enough detail to explain what specifically they are testing.
Date Wed, 09 May 2012 00:07:51 GMT


Jesse MacFadyen commented on CB-671:

Part of the point was that the tests should contain more descriptive information.
The test is described as : "resolve invalid URL"
The test verifies that window.resolveLocalFileSystemURI("/",...) causes
But why is this NOT a valid url?: "/"
Why is this an ENCODING_ERR?

Currently, when I have a failing test, I have to parse the test to determine if it is a valid
test, then I have to go to the docs and verify that the test proves the documented functionality,
then usually jump over and read a W3C spec or 2, then get down to fixing the implementation.

Wherever possible, a better description would save a ton of time, ie 

it("resolve non-existent URL causes ENCODING_ERR", ... )

This I could easily parse and realize that, no, wait, that should be a NOT_FOUND_ERR so there
is an issue with the test ... and just fix the test.

Regardless, I will fix it.
> Tests should be described in enough detail to explain what specifically they are testing.
> -----------------------------------------------------------------------------------------
>                 Key: CB-671
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Improvement
>          Components: mobile-spec
>            Reporter: Jesse MacFadyen
>            Assignee: Filip Maj
>            Priority: Minor
> The following test is supposed to fail, however it is not clear why ...
> Upon digging deeper, it appears that it is actually supposed to return a FileError.NOT_FOUND_ERR,
but there is no way to know for sure, short of asking whoever wrote it.
> Code from :
> it("resolve invalid URL", function() {
>   var fail = jasmine.createSpy().andCallFake(function(error) {
>       expect(error).toBeDefined();
>       expect(error.code).toBe(FileError.ENCODING_ERR);
>   }),
>   win = createWin('window.resolveLocalFileSystemURI');
>   // lookup file system entry
>   runs(function() {
>     window.resolveLocalFileSystemURI("/", win, fail);
>   });
>   waitsFor(function() { return fail.wasCalled; }, "error callback never called", Tests.TEST_TIMEOUT);
>   runs(function() {
>      expect(fail).toHaveBeenCalled();
>      expect(win).not.toHaveBeenCalled();
>    });
> });

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message