aws-lambda-runner 1.5.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c5f197efab92eddcd95b273da0e8b246b1e6f6aa
4
- data.tar.gz: 6d5bc45491b52c7cce37100c25766c41e3a1e7ad
3
+ metadata.gz: d8d0f7a5abbdbc8dd35fa88a68e1c72fbe60dcaf
4
+ data.tar.gz: 89681af4dba236e7b907bcbaeb220a3073537600
5
5
  SHA512:
6
- metadata.gz: 383a7964ea00cf6f5df36b43d0d52a06d1455b46d748a74177a927b71202a96c9e2fa738e1b510af05b1c175d9a10eaba18c791256b24d57dad4de9d494a2e63
7
- data.tar.gz: 6d7435e028758058c7fd7a0aa0e723aaeb5cd2d464fd197fd01d95e79d157cfded220049fc03732cc8663955fa8fa1f249ad9861183cc045c6d7d223d38723e2
6
+ metadata.gz: 90a6c831e0e2b6f4d26b4196d0bb1bcebe3b416d835d1becd518487aad4e922f28d835939348353293e43a5d86d334ea8f2f69d97022ab003709a29e04eba513
7
+ data.tar.gz: 91b880c61286edf103a389f97e4b11bb9dfbf74a82996f310996cbd2cb9b343548a96f134ad27df21b716182c12fe187e7e189d6934e16d3af1d7ed6d7979e11
@@ -9,18 +9,18 @@
9
9
  "author": "",
10
10
  "license": " ",
11
11
  "devDependencies": {
12
- "assert": "^1.3.0",
13
- "jshint": "^2.5.11",
14
- "mocha": "^2.1.0",
15
- "mocha-jshint": "0.0.9",
16
- "mock-res": "^0.2.1",
17
- "should": "^4.6.0"
12
+ "assert": "^1.4.1",
13
+ "jshint": "^2.9.4",
14
+ "mocha": "^3.3.0",
15
+ "mocha-jshint": "^2.3.1",
16
+ "mock-res": "^0.4.1",
17
+ "should": "^11.2.1"
18
18
  },
19
19
  "dependencies": {
20
- "aws-sdk": "^2.1.34",
21
- "istanbul": "^0.3.6",
20
+ "aws-sdk": "*",
21
+ "istanbul": "^0.4.5",
22
22
  "merge": "^1.2.0",
23
- "mock-req": "^0.1.0",
23
+ "mock-req": "^0.2.0",
24
24
  "stdio": "^0.2.7"
25
25
  }
26
26
  }
@@ -53,9 +53,6 @@ var makeContextObject = function (timeout, overrides) {
53
53
  return approximateEndTime - (new Date().getTime());
54
54
  };
55
55
 
56
- context.fail = function(err) { context.done(err, null); };
57
- context.succeed = function(data) { context.done(null, data); };
58
-
59
56
  return context;
60
57
  };
61
58
 
@@ -75,7 +72,7 @@ var startJob = function (job, requestObject, handler, opts) {
75
72
  };
76
73
 
77
74
  try {
78
- handler(event, context);
75
+ handler(event, context, context.done);
79
76
  } catch (e) {
80
77
  console.log("Handler crashed", e);
81
78
  job.doError(e);
@@ -73,9 +73,10 @@ module LambdaRunner
73
73
 
74
74
  # aws events
75
75
  class Events
76
- def self.s3_event(bucket, key)
76
+ def self.s3_event(bucket, key, eventName='ObjectCreated:Put')
77
77
  event = load_json('sample_s3_event.json')
78
78
  event['Records'].each do |record|
79
+ record['eventName'] = eventName
79
80
  record['s3']['bucket'].update('name' => bucket,
80
81
  'arn' => 'arn:aws:s3:::' + bucket)
81
82
  record['s3']['object']['key'] = key
@@ -5,7 +5,7 @@ describe LambdaRunner::Runner do
5
5
 
6
6
  before(:all) do
7
7
  test_js = File.expand_path("test.js", File.dirname(__FILE__))
8
- @under_test = LambdaRunner::Runner.new(test_js, "node_0_10_42_handler")
8
+ @under_test = LambdaRunner::Runner.new(test_js, "node_4_3_handler")
9
9
  @under_test.start
10
10
  end
11
11
 
@@ -13,12 +13,12 @@ describe LambdaRunner::Runner do
13
13
  @under_test.stop
14
14
  end
15
15
 
16
- it "should emulate AWS Lambda (node.js v0.10.42) - success" do
16
+ it "should emulate AWS Lambda (node.js v4.3) - success" do
17
17
  r = @under_test.process_event({ succeed: { delay: 50, result: "ohai" } })
18
18
  expect(r).to eq("ohai")
19
19
  end
20
20
 
21
- it "should emulate AWS Lambda (node.js v0.10.42) - failure" do
21
+ it "should emulate AWS Lambda (node.js v4.3) - failure" do
22
22
  expect {
23
23
  @under_test.process_event({ fail: { delay: 50, err: "oh noes" } })
24
24
  }.to raise_error("oh noes")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-lambda-runner
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - andrew wheat
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2017-02-03 00:00:00.000000000 Z
14
+ date: 2017-05-19 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: process-helper