serverless-localstack
Advanced tools
Comparing version 1.1.2 to 1.1.3
{ | ||
"name": "serverless-localstack", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "Connect Serverless to LocalStack!", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -211,2 +211,3 @@ [](https://travis-ci.org/localstack/serverless-localstack) | ||
* v1.1.3: Fix replacing host from environment variable `AWS_ENDPOINT_URL` | ||
* v1.1.2: Unify construction of target endpoint URL, add support for configuring `AWS_ENDPOINT_URL` | ||
@@ -213,0 +214,0 @@ * v1.1.1: Fix layer deployment if `mountCode` is enabled by always packaging and deploying |
@@ -180,5 +180,26 @@ 'use strict'; | ||
// url should either start with 'http://localhost' or 'http://127.0.0.1 | ||
expect(templateUrl).to.satisfy((url) => url.startsWith(`${config.host}`) || url.startsWith('http://127.0.0.1')); | ||
expect(templateUrl).to.satisfy((url) => url === `${config.host}:4566/path/to/template` || url === 'http://127.0.0.1:4566/path/to/template'); | ||
}); | ||
it('should overwrite the S3 hostname with the value from environment variable', async () => { | ||
// Set environment variable to overwrite the default host | ||
process.env.AWS_ENDPOINT_URL = 'http://localstack:4566'; | ||
const pathToTemplate = 'https://s3.amazonaws.com/path/to/template'; | ||
const request = sinon.stub(awsProvider, 'request'); | ||
instance = new LocalstackPlugin(serverless, defaultPluginState); | ||
await simulateBeforeDeployHooks(instance); | ||
await awsProvider.request('s3', 'foo', { | ||
TemplateURL: pathToTemplate | ||
}); | ||
// Remove the environment variable again to not affect other tests | ||
delete process.env.AWS_ENDPOINT_URL | ||
expect(request.called).to.be.true; | ||
let templateUrl = request.firstCall.args[2].TemplateURL; | ||
expect(templateUrl).to.equal('http://localstack:4566/path/to/template'); | ||
}); | ||
it('should not send validateTemplate calls to localstack', async () => { | ||
@@ -185,0 +206,0 @@ const request = sinon.stub(awsProvider, 'request'); |
@@ -787,3 +787,3 @@ 'use strict'; | ||
} | ||
return url.href; | ||
return url.origin; | ||
} | ||
@@ -790,0 +790,0 @@ |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
253
58886
14
1101
19
4