incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Filip Maj (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (CB-671) Tests should be described in enough detail to explain what specifically they are testing.
Date Tue, 08 May 2012 22:47:50 GMT

     [ https://issues.apache.org/jira/browse/CB-671?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Filip Maj resolved CB-671.
--------------------------

    Resolution: Fixed

Fixed in [35a3f3|https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-mobile-spec.git;a=commit;h=35a3f3f4a56898f8a14264a07e5e6c26acf5aaf8].

I added a custom matcher to the top of file.tests.js. You can use it by calling {{expect(error).toBeFileError(FileError.ERROR_CONSTANT_HERE);}}.

When the FileError codes do not match up now the output is of the form:

Expected FileError with code INVALID_MODIFICATION_ERR (9) to be NOT_FOUND_ERR (1).
                
> Tests should be described in enough detail to explain what specifically they are testing.
> -----------------------------------------------------------------------------------------
>
>                 Key: CB-671
>                 URL: https://issues.apache.org/jira/browse/CB-671
>             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 : https://github.com/apache/incubator-cordova-mobile-spec/blob/master/autotest/tests/file.tests.js#L255
> 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("/this.is.not.a.valid.url", 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: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message