Skip to content

Commit eb1e079

Browse files
committed
tweak readme example
1 parent 20df34c commit eb1e079

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mapbox/mock-aws-sdk-js",
3-
"version": "0.0.1",
3+
"version": "0.0.2",
44
"description": "Create stubbed aws-sdk-js clients for testing purposes",
55
"main": "index.js",
66
"engines": {

readme.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,18 @@ test('gets S3 object', function(assert) {
3636
var data = { Body: new Buffer('hello world') };
3737
var expected = { Bucket: 'bucket', Key: 'key' };
3838

39-
var getObject = AWS.stub('S3', 'getObject', function(params, callback) {
39+
AWS.stub('S3', 'getObject', function(params, callback) {
40+
assert.deepEqual(params, expected, 'called s3.getObject with expected params');
4041
callback(null, data);
4142
});
4243

43-
app(function(err, data) {
44+
app.useCallback(function(err, data) {
4445
assert.ifError(err, 'success');
4546
assert.equal(data, 'hello world');
4647

47-
assert.equal(AWS.S3.callCount, 1, 'one s3 client created');
48-
assert.ok(AWS.S3.calledWithExactly({ region }), 's3 client created for the correct region');
49-
5048
assert.equal(getObject.callCount, 1, 'called s3.getObject once');
51-
assert.ok(getObject.calledWith(expected), 'called s3.getObject with expected params');
49+
assert.equal(AWS.S3.callCount, 1, 'one s3 client created');
50+
assert.ok(AWS.S3.calledWithExactly({ region: 'eu-west-1' }), 's3 client created for the correct region');
5251

5352
AWS.S3.restore();
5453
assert.end();

0 commit comments

Comments
 (0)