Links

Test your module

Before testing, make sure you have these commands in your package.json:
package.json
{
...
"scripts": {
"local": "marjory local",
"action": "marjory action",
"package": "marjory package"
},
...
}

Commands

action

To test a single action within the command line, you can run the action command with the name of the action, the data you need for it, and if you use the Store, you can pass in a store object to test your action.
Before launching this command, you need to create a credentials.json file with at least an empty object. You can pass your credentials if needed in this file without the need to specify it in the command.
Yarn
NPM
npx
yarn action \
-n actionName \
-d /path/to/dataExample.json
-s /path/to/storeExample.json
npm run action \
-n actionName \
-d /path/to/dataExample.json
-s /path/to/storeExample.json
npx marjory action \
-n actionName \
-d /path/to/dataExample.json
-s /path/to/storeExample.json

local

To launch your module in development mode on http://localhost:3000:
Yarn
NPM
npx
yarn local # Port 3000 by default
npm run local
npx marjory local
You can now launch your favorite API test tools or simply use CURL to test your functions:
curl \
-d '{ "data": { "id": "1234" }, "credentials": {}, "store": {} }' \
-H "Content-Type: application/json" \
-X \
POST http://localhost:3000/actions/actionName