if (error) {
return done(error);
}
- return $.ajax({
+ $.ajax({
url: protocolName + "://fake-host",
success: function(data) {
assert.equal(data, text);
if (error) {
return done(error);
}
- return $.ajax({
+ $.ajax({
url: protocolName + "://fake-host",
success: function(data) {
assert.equal(data, String(fileContent));
it('sets Access-Control-Allow-Origin', function(done) {
var handler = function(request, callback) {
- return callback(filePath);
+ callback(filePath);
};
protocol.registerFileProtocol(protocolName, handler, function(error) {
if (error) {
});
it('sends object as response', function(done) {
var handler = function(request, callback) {
- return callback({
+ callback({
path: filePath
});
};
res.end(text);
server.close();
});
- return server.listen(0, '127.0.0.1', function() {
+ server.listen(0, '127.0.0.1', function() {
var port = server.address().port;
var url = "http://127.0.0.1:" + port;
var handler = function(request, callback) {
var doubleHandler = function(request, callback) {
try {
callback(text);
- return callback();
+ callback();
} catch (error) {
// Ignore error
}