Trying to run s3 upload from a mocha test:
'use strict';
describe('S3 test', function() {
it.only('S3 test 1', function*() {
var AWS = require('aws-sdk');
//AWS.config.region = 'us-west-2';
var s3 = new AWS.S3({
params: { Bucket: 'test-1-myBucket', Key: 'myKey' }
});
s3.createBucket(function(err) {
if (err) {
console.log("Error:", err);
} else {
s3.upload({
Body: 'Hello!'
}, function() {
console.log("Successfully uploaded data to myBucket/myKey");
});
}
});
});
});
but nothing happens, it is not sending the http request at all. Why is that?