How to use the assert.include function in assert

To help you get started, we’ve selected a few assert examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github yui / yeti / test / old / server.js View on Github external
"the document should have $yetify" : function (body) {
                assert.isString(body);
                var cachebuster = server.getCachebuster();
                var injection = "";
                assert.include(body, injection);
                // injection appears at the end:
                var idx = body.indexOf(injection);
                assert.equal(
                    idx + injection.length,
                    body.length
                );
            }
        },
github yui / yeti / test / unit / test-server-serve.js View on Github external
"the correct headers are returned": function (server) {
                assert.include(server.res.headers, "Content-Length");
                assert.include(server.res.headers, "Content-Type");
                assert.include(server.res.headers, "Expires");
                assert.include(server.res.headers, "Date");
            },
            "no script is injected": function (server) {
github pump-io / pump.io / test / note-api-test-system.js View on Github external
"results look right": function(err, note, act) {
                        assert.ifError(err);
                        assert.isObject(note);
                        assert.include(note, "id");
                        assert.isString(note.id);
                        assert.include(note, "published");
                        assert.isString(note.published);
                        assert.include(note, "updated");
                        assert.isString(note.updated);
                        assert.include(note, "author");
                        assert.isObject(note.author);
                        assert.include(note.author, "id");
                        assert.isString(note.author.id);
                        assert.include(note.author, "displayName");
                        assert.isString(note.author.displayName);
                        assert.include(note.author, "objectType");
                        assert.isString(note.author.objectType);
                    },
                    "results don't leak private members": function(err, note, act) {
github LockerProject / Locker / tests / lsyncmanager-test-local.js View on Github external
"by giving a valid install instance" : function(svcMetaInfo) {
                    assert.include(svcMetaInfo, "id");
                },
                "and by service map says it is installed" : function(svcMetaInfo) {
github pump-io / pump.io / test / distributor-followers-remote-test-as-root.js View on Github external
"it includes the activity": function(err, feed, act) {
                                    assert.ifError(err);
                                    assert.isObject(feed);
                                    assert.isObject(act);
                                    assert.include(feed, "items");
                                    assert.isArray(feed.items);
                                    assert.greater(feed.items.length, 0);
                                    assert.isObject(_.find(feed.items, function(item) { return item.id === act.id; }));
                                }
                            }
github yui / yeti / test / functional / cli.js View on Github external
"the stderr output contains the failing test details": function (topic) {
                        assert.include(topic.output, "testMoof");
                        assert.include(topic.output, "Values should be equal.");
                        assert.include(topic.output, "Expected: moof (string)");
                        assert.include(topic.output, "Actual: ? (string)");
                        assert.include(topic.output, "1 of 1 tests failed");
                    },
                    "the stderr output contains Agent complete": function (topic) {
github pump-io / pump.io / test / user-inbox-api-test-as-root.js View on Github external
"it includes our posted activity": function(err, feed, act) {
                        assert.ifError(err);
                        assert.isObject(feed);
                        assert.include(feed, "items");
                        assert.isArray(feed.items);
                        assert.greater(feed.items.length, 0);
                        assert.isTrue(_.some(feed.items, function(item) {
                            return (_.isObject(item) && item.id === act.id);
                        }));
                    }
                }
github pump-io / pump.io / test / distributor-remote-test-as-root.js View on Github external
assert.equal(serverOf(maven.following.url), "social.localhost");

                            assert.include(maven, "favorites");
                            assert.isObject(maven.favorites);
                            assert.include(maven.favorites, "url");
                            assert.equal(serverOf(maven.favorites.url), "social.localhost");

                            assert.include(maven, "lists");
                            assert.isObject(maven.lists);
                            assert.include(maven.lists, "url");
                            assert.equal(serverOf(maven.lists.url), "social.localhost");

                            assert.include(maven, "links");
                            assert.isObject(maven.links);

                            assert.include(maven.links, "self");
                            assert.isObject(maven.links.self);
                            assert.include(maven.links.self, "href");
                            assert.equal(serverOf(maven.links.self.href), "social.localhost");

                            assert.include(maven.links, "activity-inbox");
                            assert.isObject(maven.links["activity-inbox"]);
                            assert.include(maven.links["activity-inbox"], "href");
                            assert.equal(serverOf(maven.links["activity-inbox"].href), "social.localhost");

                            assert.include(maven.links, "self");
                            assert.isObject(maven.links["activity-outbox"]);
                            assert.include(maven.links["activity-outbox"], "href");
                            assert.equal(serverOf(maven.links["activity-outbox"].href), "social.localhost");
                        }
                    },
github jamescarr / paynode / spec / unit / gateway-client.spec.js View on Github external
'should include host, path, and contentType as required':function(err){
      assert.include(err.message, 'host')
      assert.include(err.message, 'path')
      assert.include(err.message, 'contentType')
    }
  },
github vowsjs / vows / lib / assert / macros.js View on Github external
assert.deepInclude = function (actual, expected, message) {
    assertMissingArguments(arguments, assert.deepInclude);
    if (!isArray(actual)) {
        return assert.include(actual, expected, message);
    }
    if (!actual.some(function (item) { return utils.deepEqual(item, expected) })) {
        assert.fail(actual, expected, message || "expected {actual} to include {expected}", "include", assert.deepInclude);
    }
};
assert.deepIncludes = assert.deepInclude;