64 Commits

Author SHA1 Message Date
Mariusz Nowak
3808471972 test: Move unit tests to "test/unit" folder 2020-11-30 16:53:52 +01:00
Graham McGregor
06f6c6d28e
refactor: Refactor some functions to native promises (#8533) 2020-11-25 13:40:48 +01:00
Mariusz Nowak
8c3c7c4e3a chore: Rename "tests" folder to "test"
Also upgrade @serverless/eslint-config to v2
2020-08-28 16:22:09 +02:00
Mark Tse
e62ddadc9d chore - stop using deprecated 'new Buffer()' method. 2019-10-13 15:15:26 -04:00
Edmundo Rodrigues
70fa0d82dd feat: add qualifier option to invoke command 2019-09-18 18:00:52 -03:00
drexler
5e425a7f84 test: update covering tests 2019-09-11 07:49:19 -04:00
Mariusz Nowak
4fa9854f81
Fix restore of process.stdin 2019-09-05 16:12:50 +02:00
Daniel Schep
e2e9a77c46 alternative approach to creds fail fast taht includes metadata check 2019-07-22 14:59:49 -04:00
Mariusz Nowak
4944f471b1
Prettify 2019-06-26 12:43:01 +02:00
Philipp Muens
773e9af3c1 Thorough integration testing 2019-05-30 15:20:58 +02:00
Philipp Muens
25ca3bb84d Setup Travis to work with Windows / Remove AppVeyor 2019-05-21 12:34:15 +02:00
Mariusz Nowak
8fcfee6168
Ensure to not wait for stdin when testing 2019-05-16 10:07:20 +02:00
Alexey Kotlyarov
d5dc0cbf4b Do not explicitly color messages in white
On white background terminals, white text is unreadable. Use the default
terminal color instead.

Fixes #4673
2018-01-29 19:33:35 +11:00
Erik Erikson
ca5ba8daac Remove unused parameters in platform.js (and deal with consequences)
Add explicit use of options where they were defined.
2017-12-12 11:59:08 -08:00
Erik Erikson
bf8d57fa9f Improve Stage and Region Usage
Remove the errant (but understandable) distributed usage of region and stage settings.  This otherwise locks in a multitude of bugs around the improper algorithm for selecting (given all context) the proper region or stage setting.  Instead, all code should use the centralized algorithm for determining such values.  This creates a strange first and second class configuration concept but these two are sufficiently varied and complex in their creation and use that this seems appropriate.
2017-12-11 16:39:44 -08:00
Frank Schmid
81c896bc12
Removed reintroduction of stage+region in request. Added options.
Delete bucket was still using them

Hopefully all :)

Further test fixes.

.... worked too long yesterday

Fixed Variable tests

Remove not used parameters from request() and add options with warning
2017-12-11 12:33:35 +01:00
Dmitri Zimine
c4374ec6b1 Optionally pass raw string, take 1 2017-08-03 10:28:53 -07:00
Dan Root
add4951a4b Better handling for AWS Lambda logging lines.
Refactor duplicated log line formatting from invoke and logs plugins
into utils/formatLambdaLogEvent.js and add tests.

Make log line formatter understand default python logging module output
from Lambda functions.

Add payload output testing to invoke plugin.

Fixes #1796 and #3594
2017-05-19 12:42:02 -07:00
Doug Moscrop
1012c351b7 add sinon-bluebird to make promises in tests a bit cleaner 2017-02-08 12:59:18 -05:00
Maciej Winnicki
9f3b218157
refactor tests 2016-12-14 10:47:45 +01:00
Maciej Winnicki
145911a6ae
fix lint 2016-12-14 10:13:12 +01:00
Joe Stanton
b5284df55f
Reject promise and handle exit code in the wrapper 2016-12-14 10:11:51 +01:00
Joe Stanton
fb1b4ef14a
Correct exit code for failed function invocation 2016-12-14 10:09:04 +01:00
Eslam A. Hefnawy
08009c2945 handling strings 2016-12-13 18:08:05 +07:00
Eslam A. Hefnawy
142946e295 fixed bug where you can now invoke without any input data 2016-12-13 17:52:03 +07:00
Maciej Winnicki
b78f7ac254
remove duplicated tests 2016-12-08 11:23:18 +01:00
Maciej Winnicki
5a978afa92
add support for stdin in invoke command 2016-12-08 10:48:53 +01:00
Philipp Muens
a39e2969de Remove reassignment of this.options.data if JSON parsing fails 2016-11-29 15:06:10 +01:00
Philipp Muens
f02c990fd8 Remove check if options.data exists 2016-11-29 13:32:29 +01:00
Philipp Muens
d048cc3e09 Add check if data is JSON or simple string 2016-11-29 10:35:26 +01:00
Philipp Muens
ef7ccfc8e3 Add tests 2016-11-29 10:35:26 +01:00
Philipp Muens
7837acf360 Fix minor typos 2016-11-29 10:35:26 +01:00
ac360
ee7f0c24bf sanitize strings 2016-11-29 10:35:26 +01:00
Philipp Muens
8aad2372eb Refactor test structure
So that all tests follow the *.test.js pattern and globs are used to find test files.
2016-11-22 12:49:26 +01:00
Nik Graf
4835e6ef52 fix remove bucket tests 2016-10-20 16:08:03 +02:00
Nik Graf
6b20b24a38 fix invoke tests 2016-10-20 15:19:58 +02:00
Maciej Winnicki
6888edec91 Merge pull request #2443 from erikerikson/invoke-command-allow-absolute-path
Allow invoke to accept absolute paths
2016-10-20 09:34:22 +02:00
Philipp Muens
c273abec68 Move AwsProvider plugin into aws directory 2016-10-19 08:32:06 +02:00
Philipp Muens
c7b7472a48 Update provider properties in plugins 2016-10-19 08:32:06 +02:00
Philipp Muens
df7692ac80 Introduce AwsProvider plugin 2016-10-19 08:32:06 +02:00
Erik Erikson
0d9e6ef2f6 Allow invoke to accept absolute paths
Resolves https://github.com/serverless/serverless/issues/2442

1. Allow for the given `path` parameter to be an absolute path.  Detect this case and do not prepend the service path in this case.
2. Update docs (including random missing apostrophe)
3. Add test to verify absolute path use
2016-10-18 15:08:14 -07:00
Smith, Greg W
21586c47f3 Properly using single quotes only. 2016-09-08 17:49:25 -07:00
Smith, Greg W
f675132780 Provide data to verify YAML result. 2016-09-08 17:46:12 -07:00
Smith, Greg W
290f5af218 Adds test to AWS Invoke to vierify that YAML can be used for event input. Verifies fix for #1994. 2016-09-08 17:39:30 -07:00
Florian Motlik
f9f212b404 WIP 2016-09-05 16:18:58 +02:00
Philipp Muens
5fedf6a4f9 Add getTmpDir util method and refactor tests 2016-08-23 13:51:16 +02:00
Nick Chisiu
16aa6581ab fix #1854 - update npm devDependencies packages (#1879)
* fix #1854 - added latest version of eslint-config-airbnb-base package

* fix #1854 - added latest npm shrinkwrap scheme

* fix #1854 - added latest npm coveralls package

* fix #1854 - added latest npm eslint package

* fix #1854 - added latest npm eslint-config-airbnb package

* fix #1854 - added latest npm eslint-plugin-import package

* fix #1854 - added latest npm eslint-plugin-jsx-a11y package

* fix #1854 - added latest npm eslint-plugin-react package

* fix #1854 - fixed estlint new-parens errors for integration test

* fix #1854 - fixed estlint new-parens errors for yaml parsers tests

* fix #1854 - fixed estlint max-len errors for util tests

* fix #1854 - disabled no-extraneous-dependencies on eslintrc for NodeJS 4 incapability on this feature

* fix #1854 - fixed eslint new-parens errors for Service tests

* fix #1854 - fixed eslint new-parens errors for Serverless tests

* fix #1854 - fixed eslint new-parens errors for plugin manager tests

* fix #1854 - fixed eslint new-parens errors for plugin tracking tests

* fix #1854 - fixed eslint new-parens errors for plugin package zipService lib

* fix #1854 - fixed eslint new-parens errors for plugin package zipService tests

* fix #1854 - fixed eslint trailing spaces errors for plugin package zipService lib

* fix #1854 - fixed eslint new-parens errors for plugin package cleanup  tests

* fix #1854 - fixed eslint new-parens errors for plugin create tests

* fix #1854 - fixed eslint dot same line expectation error on plugin aws logs index

* fix #1854 - fixed eslint operator assignment error on plugin aws logs index

* fix #1854 - fixed eslint dot location error on plugin aws invoke tests

* fix #1854 - fixed eslint new-parens error on plugin aws invoke tests

* fix #1854 - fixed eslint new-parens error on plugin aws deployFunction tests

* fix #1854 - fixed eslint new-parens error on plugin aws deploy uploadDeploymentPackage tests

* fix #1854 - fixed eslint new-parens error on plugin aws deploy updateStack tests

* fix #1854 - fixed eslint new-parens error on plugin aws deploy createStack tests

* fix #1854 - fixed eslint new-parens error on plugin aws deploy apiGateway lib deployment

* fix #1854 - fixed eslint unary typeof whitespace req error on Serverless Service class

* fix #1854 - fixed eslint unary typeof whitespace req error on Serverless Service class ( second fix )

* fix #1854 - fixed eslint no-lonely-if req error on Serverless Service class

* fix #1854 - disabled react/require-extension on eslintrc because it's deprecated

* fix #1854 - AwsCompileApigEvents #constructor() should resolve if no functions are given:
                 Error: Resolution method is overspecified. Specify a callback *or* return a Promise; not both.

* fix #1854 - createStack #postCreate() should resolve:
                 Error: Resolution method is overspecified. Specify a callback *or* return a Promise; not both.

* fix #1854 - emptyS3Bucket #deleteObjects() should resolve if objectsInBucket is empty:
                 Error: Resolution method is overspecified. Specify a callback *or* return a Promise; not both.

* fix #1854 - AwsInvoke #extendedValidate() should resolve if path is not given:
                 Error: Resolution method is overspecified. Specify a callback *or* return a Promise; not both.

* fix #1854 - #cleanup() should resolve if the .serverless directory is not present:
                 Error: Resolution method is overspecified. Specify a callback *or* return a Promise; not both.

* fix #1854 -#validate() should resolve if servicePath is given:
                Error: Resolution method is overspecified. Specify a callback *or* return a Promise; not both.

* fix #1854 -  Service #load() should resolve if no servicePath is found:
                 Error: Resolution method is overspecified. Specify a callback *or* return a Promise; not both.

* fix #1854 - added latest mocha package

* fix #1854 - added latest sinon npm package

* fix #1854 - serverless/lib/plugins/aws/deploy/tests/createStack.js 136:48  error  Missing semicolon  semi

* fix #1854 - serverless/lib/plugins/package/tests/cleanup.js 35:7  error  Missing semicolon  semi

* fix #1854 - serverless/lib/plugins/package/tests/validate.js 22:49  error  Missing semicolon  semi

* fix #1854 - added latest npm shrinkwrap

* fix #1854 - fixed no-extra-boolean-cast eslint error on aws deploy apiGateway methods

* fix #1854 - fixed  new-parens eslint error on serverless tests for Service class
2016-08-18 11:51:09 +02:00
Philipp Muens
a0f7bb20d1 Add tests to increase test coverage 2016-08-08 08:27:26 +02:00
Eslam A. Hefnawy
f9b8f3d447 updated invoke and log and fixed tests 2016-08-04 22:24:58 +09:00
Eslam A. Hefnawy
044a13f47d adding default function name property 2016-08-04 21:35:02 +09:00