5.39.6 • Published 1 day ago

@webiny/api-admin-settings v5.39.6

Weekly downloads
-
License
MIT
Repository
github
Last release
1 day ago

@webiny/api-headless-cms

npm.io npm.io code style: prettier PRs Welcome

Install

npm install --save @webiny/api-headless-cms

Or if you prefer yarn:

yarn add @webiny/api-headless-cms

Testing

Due to possibility of multiple storage operations, the tests are completely decoupled from those storage operations.

The jest.setup.js is using @webiny/project-utils/testing/presets.js to find and load all the packages containing @webiny/api-headless-cms and storage-operations keywords in their package.json file. Those packages are then used to build the test run - one for each of the packages. So depending on how many storage operations there are in the repository, that much of api-headless-cms tests will run.

Defining test environment

To make it possible for api-headless-cms tests to run with a storage operations package you MUST create presets.js file in storage-operations-package-path/__tests__/__api__/ directory. That file is loaded when setting up the api-headless-cms tests.

It MUST contain the testEnvironment variable which contains path to the environment definition file.

That environment file MUST define the test environment which extends NodeEnvironment class.

Test environment MUST expose __getStorageOperationsPlugins method, via this.global property of the class, which will load the required plugins in the api-headless-cms tests.

Examples of preset and test environment files

The first implementation of the decoupled storage operations is DynamoDB/Elasticsearch, which you can find in @webiny/api-headless-cms-ddb-es. Files which you can check to help you define your own presets and test environment are:

  • presets.js - an array of presets of which last one defines the environment to be loaded
  • environment.js - a class which extends NodeEnvironment and exposes __getStorageOperationsPlugins to the tests

Debugging when testing

For the WebStorm (PhpStorm,...) when starting a test you must have some values defined in the run/debug configurations screen:

Node options

--inspect=9229

Working directory

PATH_TO_YOUR_PROJECT_ROOT

example:

~/webiny/webiny-js/

Jest options

For DynamoDB + Elasticsearch storage operations tests:

--keyword=cms:base --keyword=cms:ddb-es

For the DynamoDB storage operations tests:

--keyword=cms:base --keyword=cms:ddb

Note that base keyword is the cms:base. It tells Jest setup to load the api-headless-cms tests with the api-headless-cms-ddb-es tests.

Environment variables

If you want to use local Elasticsearch:

ELASTICSEARCH_PORT=9200;LOCAL_ELASTICSEARCH=true

Nothing if you do not want to use the local Elasticsearch.

5.39.6

1 day ago

5.39.6-beta.1

1 day ago

5.39.6-beta.0

2 days ago

5.39.5

15 days ago

5.39.5-beta.1

16 days ago

5.40.0-beta.2

15 days ago

5.40.0-beta.1

21 days ago

5.39.4

28 days ago

5.39.4-beta.1

29 days ago

5.40.0-beta.0

1 month ago

5.39.4-beta.0

2 months ago

5.39.3

2 months ago

5.39.3-beta.0

2 months ago

5.39.3-beta.1

2 months ago

5.39.2

2 months ago

5.39.2-beta.2

2 months ago

5.39.2-beta.3

2 months ago

5.39.2-beta.1

2 months ago

5.39.2-beta.0

2 months ago

5.38.6

3 months ago

5.39.1

3 months ago

5.39.1-beta.1

3 months ago

5.39.0

3 months ago

5.39.1-beta.0

3 months ago

5.39.0-beta.2

3 months ago

5.39.0-beta.3

3 months ago

5.38.5-beta.0

4 months ago

5.38.5

4 months ago

5.38.4

4 months ago

5.38.4-beta.0

4 months ago

5.38.3-beta.1

4 months ago

5.38.3

4 months ago

5.38.3-beta.0

4 months ago

5.38.2

5 months ago

5.38.2-beta.0

5 months ago

5.37.2-beta.3

9 months ago

5.37.2-beta.2

9 months ago

5.39.0-beta.0

6 months ago

5.39.0-beta.1

6 months ago

5.38.0-beta.0

6 months ago

5.37.1-beta.3

9 months ago

5.37.1-beta.1

9 months ago

5.37.1-beta.2

9 months ago

5.37.3-beta.0

8 months ago

5.37.1-beta.0

9 months ago

5.37.6-beta.0

7 months ago

5.37.5-beta.0

7 months ago

5.37.3-beta.1

8 months ago

5.37.2-beta.1

9 months ago

5.37.6-beta.1

7 months ago

5.37.3-beta.2

8 months ago

5.37.2-beta.0

9 months ago

5.37.5-beta.1

7 months ago

5.37.4-beta.1

8 months ago

5.37.4-beta.0

8 months ago

5.37.8-beta.0

7 months ago

5.37.7-beta.0

7 months ago

5.38.0-beta.5

6 months ago

5.38.0-beta.6

6 months ago

5.38.0-beta.3

6 months ago

5.38.0-beta.4

6 months ago

5.38.0-beta.1

6 months ago

5.38.0-beta.2

6 months ago

5.38.1-beta.0

6 months ago

5.37.0-beta.3

10 months ago

5.37.0-beta.2

10 months ago

5.37.0-beta.1

10 months ago

5.37.7

7 months ago

5.37.8

7 months ago

5.37.5

7 months ago

5.37.6

7 months ago

5.37.3

8 months ago

5.37.4

8 months ago

5.37.1

9 months ago

5.37.2

9 months ago

5.37.0

10 months ago

5.34.9-beta.0

8 months ago

5.38.0

6 months ago

5.38.1

6 months ago

5.36.2

11 months ago

5.36.2-beta.2

11 months ago

5.36.2-beta.1

11 months ago

5.37.0-beta.0

11 months ago

5.36.2-beta.0

11 months ago

5.35.4

11 months ago

5.35.4-beta.1

11 months ago

5.35.4-beta.0

11 months ago

5.35.3

12 months ago

5.36.1

12 months ago

5.36.1-beta.1

12 months ago

5.36.1-beta.0

12 months ago

5.35.3-beta.0

12 months ago

5.36.0

12 months ago

5.36.0-beta.2

12 months ago

5.36.0-beta.1

12 months ago

5.36.0-beta.0

12 months ago

5.35.2

12 months ago

5.35.2-beta.0

12 months ago

5.35.1

12 months ago

5.35.1-beta.0

12 months ago

5.35.0

1 year ago

5.35.0-beta.2

1 year ago

5.35.0-beta.1

1 year ago

5.35.0-beta.0

1 year ago

5.34.8

1 year ago

5.34.8-beta.1

1 year ago

5.34.8-beta.0

1 year ago

5.34.7

1 year ago

5.34.7-beta.2

1 year ago

5.34.7-beta.1

1 year ago

5.34.7-beta.0

1 year ago

5.34.6

1 year ago

5.34.6-beta.6

1 year ago

5.34.6-beta.5

1 year ago

5.34.6-beta.4

1 year ago

5.34.6-beta.3

1 year ago

5.34.6-beta.2

1 year ago

5.34.6-beta.1

1 year ago

5.34.6-beta.0

1 year ago

5.34.5

1 year ago

5.34.5-beta.1

1 year ago

5.34.5-beta.0

1 year ago

5.34.4

1 year ago

5.34.4-beta.0

1 year ago

5.34.3

1 year ago

5.34.3-beta.3

1 year ago

5.34.3-beta.2

1 year ago

5.34.3-beta.1

1 year ago

5.34.3-beta.0

1 year ago

5.34.2

1 year ago

5.34.2-beta.2

1 year ago

5.34.2-beta.1

1 year ago

5.34.2-beta.0

1 year ago

5.34.1

1 year ago

5.34.1-beta.3

1 year ago

5.34.1-beta.2

1 year ago

5.34.1-beta.1

1 year ago

5.34.1-beta.0

1 year ago

5.34.0

1 year ago

5.34.0-beta.2

1 year ago

5.34.0-beta.1

1 year ago

5.34.0-beta.0

1 year ago