Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

serverless-test-plugin

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

serverless-test-plugin - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

7

index.js

@@ -102,2 +102,5 @@ 'use strict';

// Set an environment variable the invoked functions can check for
process.env.SERVERLESS_TEST = true;
// Prepare result object

@@ -256,3 +259,5 @@ evt.data.result = { status: false };

return resolve();
});
}).finally() {
process.env.SERVERLESS_TEST = undefined;
};
});

@@ -259,0 +264,0 @@ }

2

package.json
{
"name": "serverless-test-plugin",
"version": "0.1.3",
"version": "0.1.4",
"engines": {

@@ -5,0 +5,0 @@ "node": ">=4.0"

#Serverless Test Plugin
[![npm version](https://badge.fury.io/js/serverless-test-plugin.svg)](https://badge.fury.io/js/serverless-test-plugin)
Simple _Integration Test Framework_ for [Serverless](http://www.serverless.com). This plugin is basically a

@@ -8,5 +10,5 @@ reimplementation of the `run` command, validating a function's _success_. You can test all

This plugin is intended to run _besides_ your regular Unit Tests such as [Mocha](https://mochajs.org/).
This plugin is intended to run _besides_ your regular Unit Tests such as [Mocha](https://mochajs.org/), not as a replacement. It will solely validate that your functions have no compilation errors and can successfully run the provided `event.json`. At this point there's no output validation other than checking for success, failure or a timeout (that is, if your Lambda code exceeds the specified timeout value).
**Note:** Serverless *v0.1.4* or higher is required.
Typically you want to run this plugin right before deploying your Lambda code.

@@ -20,3 +22,5 @@

**Note:** Serverless *v0.1.4* or higher is required.
###Configuration

@@ -40,3 +44,3 @@

* `skip` - boolean; skip this function from all tests
* `event` - string; name of the event JSON definition; defaults to `event.js`
* `event` - string; name of the event JSON definition; defaults to `event.json`

@@ -66,1 +70,9 @@

To detect whether your code runs in a test environment or not, check for the `SERVERLESS_TEST` environment variable:
```
if (process.env.SERVERLESS_TEST) {
console.log("This code runs as part of an intergration test.");
}
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc