node-lambda 1.1.0 → 1.2.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.
package/CHANGELOG.md CHANGED
@@ -463,3 +463,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
463
463
 
464
464
  ### Bugfixes
465
465
  - fix the bug in `excludeGlobs` in `_fileCopy` [#609](https://github.com/motdotla/node-lambda/pull/609)
466
+
467
+ ## [1.2.0] - 2022-12-21
468
+ ### Features
469
+ - Add support for nodejs18x [#616](https://github.com/motdotla/node-lambda/pull/616)
package/lib/main.js CHANGED
@@ -52,7 +52,7 @@ event_sources.json and ${program.eventFile} files as needed.`)
52
52
  }
53
53
 
54
54
  async run (program) {
55
- if (!['nodejs14.x', 'nodejs16.x'].includes(program.runtime)) {
55
+ if (!['nodejs14.x', 'nodejs16.x', 'nodejs18.x'].includes(program.runtime)) {
56
56
  console.error(`Runtime [${program.runtime}] is not supported.`)
57
57
  process.exit(254)
58
58
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-lambda",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "Command line tool for locally running and remotely deploying your node.js applications to Amazon Lambda.",
5
5
  "main": "lib/main.js",
6
6
  "directories": {
package/test/main.js CHANGED
@@ -151,7 +151,7 @@ describe('lib/main', function () {
151
151
  })
152
152
 
153
153
  it('version should be set', () => {
154
- assert.equal(lambda.version, '1.1.0')
154
+ assert.equal(lambda.version, '1.2.0')
155
155
  })
156
156
 
157
157
  describe('_codeDirectory', () => {
@@ -171,6 +171,27 @@ describe('bin/node-lambda', () => {
171
171
  })
172
172
  })
173
173
 
174
+ describe('node-lambda run (Runtime nodejs18.x is supported)', () => {
175
+ const eventObj = {
176
+ asyncTest: false,
177
+ callbackWaitsForEmptyEventLoop: true // True is the default value of Lambda
178
+ }
179
+
180
+ before(() => {
181
+ process.env.AWS_RUNTIME = 'nodejs18.x'
182
+ })
183
+ after(() => {
184
+ process.env.AWS_RUNTIME = 'nodejs16.x'
185
+ })
186
+
187
+ it('`node-lambda run` exitCode is not `254` (callback(null))', (done) => {
188
+ _generateEventFile(Object.assign(eventObj, {
189
+ callbackCode: 'callback(null);'
190
+ }))
191
+ _testMain({ stdoutRegExp: /Success:$/, exitCode: 0 }, done)
192
+ })
193
+ })
194
+
174
195
  describe('node-lambda run (Multiple events))', () => {
175
196
  const eventObj = [{
176
197
  asyncTest: false,