How to use the chai.assert.include function in chai

To help you get started, we’ve selected a few chai 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 motdotla / node-lambda / test / main.js View on Github external
return lambda._archive(_program).then((data) => {
          // same test as "installs and zips with an index.js file and node_modules/aws-sdk"
          const archive = new Zip(data)
          const contents = Object.keys(archive.files).map((k) => {
            return archive.files[k].name.toString()
          })
          assert.include(contents, 'index.js')
          assert.include(contents, 'node_modules/aws-sdk/lib/aws.js')
        })
      })
github palantir / tslint / test / runner / runnerTests.ts View on Github external
it("outputs relative path without --outputAbsolutePaths", async () => {
        const { status, stdout, stderr } = await runLint(customRulesOptions);
        assert.equal(status, 2);
        assert.include(stdout, "ERROR: src/");
        assert.equal(stderr, "");
    });
});
github LimeChain / etherlime / test / cli-commands / compile / compile-dependencies.js View on Github external
it('should create new extendable error', function () {
            assert.include(JSON.stringify(extendableError), "Can not compile contracts.")
        });
github frictionlessdata / datapackage-js / test / package.js View on Github external
it('throws errors for invalid datapackage in strict mode', async () => {
      const error = await catchError(Package.load, {}, {strict: true})
      assert.instanceOf(error, Error)
      assert.instanceOf(error.errors[0], Error)
      assert.include(error.errors[0].message, 'required property')
    })
github mtford90 / siesta / test / events.spec.js View on Github external
it('notif contains change', function() {
          assert.equal(event.field, 'colours');
          assert.equal(event.type, ModelEventType.Splice);
          assert.equal(event.index, 1);
          assert.equal(event.removed.length, 1);
          assert.include(event.removed, 'blue');
          assert.equal(event.added.length, 0);
        });
      });
github fed135 / Kalm / tests / tempunit.js View on Github external
it('sendOnce', (done) => {
		channel.sendOnce('foo');
		assert.isNotNull(channel._timer);
		assert.include(channel.packets, 'foo');
		channel.sendOnce('foo2');
		assert.notInclude(channel.packets, 'foo');
		assert.include(channel.packets, 'foo2');

		setTimeout(() => {
			assert.equal(channel.packets.length, 0);
			assert.isNull(channel._timer);
			done();
		}, Kalm.defaults.bundler.delay + 1);
	});
github BrowserSync / browser-sync / test / specs / e2e / e2e.options.sockets.js View on Github external
.end(function(err, res) {
                assert.include(res.text, "location.host + '/shane'");
                done();
            });
    });
github OptimalBits / node_acl / test / tests.js View on Github external
acl.whatResources('fumanchu', function (err, resources) {
        assert.isNull(err)

        assert.isFalse('blogs' in resources)
        assert.property(resources, 'news')
        assert.include(resources.news, 'get')
        assert.include(resources.news, 'put')
        assert.isFalse('delete' in resources.news)

        assert.property(resources, 'forums')
        assert.include(resources.forums, 'delete')
        assert.include(resources.forums, 'put')
        done()
      })
    })
github eslint / eslint / tests / lib / cli-engine / formatters / codeframe.js View on Github external
errorCount: 1,
                warningCount: 0,
                fixableErrorCount: 1,
                fixableWarningCount: 0,
                messages: [{
                    message: "Unexpected foo.",
                    severity: 2,
                    line: 5,
                    column: 10,
                    ruleId: "foo"
                }]
            }];

            const result = formatter(code);

            assert.include(result, "1 error potentially fixable with the `--fix` option.");
        });
github Crossbow-js / crossbow-sites / test / specs / data / data.item.js View on Github external
cb: function (err, out) {
                if (err) {
                    return done(err);
                }
                assert.include(out.get("compiled"), "<h1>Human</h1>");
                done();
            }
        });