cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stevengill <...@git.apache.org>
Subject [GitHub] cordova-lib pull request #510: Fixjasmine : CB:12018 - updating tests in cor...
Date Fri, 16 Dec 2016 06:05:04 GMT
Github user stevengill commented on a diff in the pull request:

    https://github.com/apache/cordova-lib/pull/510#discussion_r92756760
  
    --- Diff: cordova-lib/spec-cordova/helpers.js ---
    @@ -148,7 +148,7 @@ module.exports.writeConfigContent = function (appPath, configContent)
{
     
     // Add the toExist matcher.
     beforeEach(function () {
    -    this.addMatchers({
    +    jasmine.addMatchers({
             'toExist': function () {
    --- End diff --
    
    I rewrote `toExist` with the new [custom matcher syntax](https://jasmine.github.io/2.0/custom_matcher.html).
This should fix some of your failing specs. 
    
    Replace this `toExist` with:
    
    ```
    jasmine.addMatchers({
            'toExist': function () {
                return {
                    compare: function(actual, expected) {
                        var notText = this.isNot ? ' not' : '';
                        var result = {};
    
                        result.pass = fs.existsSync(actual);
    
                        if(result.pass) {
                            result.message = "expected " + actual + " to not exist";
                        } else {
                            result.message = "expected " + actual + " to exist";
                        }
    
                        return result;
                    }
                }
            }
        });
    ```
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


Mime
View raw message