Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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')
})
})
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, "");
});
});
it('should create new extendable error', function () {
assert.include(JSON.stringify(extendableError), "Can not compile contracts.")
});
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')
})
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);
});
});
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);
});
.end(function(err, res) {
assert.include(res.text, "location.host + '/shane'");
done();
});
});
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()
})
})
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.");
});
cb: function (err, out) {
if (err) {
return done(err);
}
assert.include(out.get("compiled"), "<h1>Human</h1>");
done();
}
});