This snapshot type is used along with the Git connector. It allows you to take snaphots of entire JSON files as resources to test.

Notes: Limitations

As of now, there is no way to select only a portion of the JSON file and this makes your tests more complex but we are working on it!

CloudFormation and Azure ARM templates

We currently do not support any of the CloudFormation or Azure Resource Management templates, but you can use this snapshot type to read the JSON version of these templates until we have a proper snapshot type dedicated to these template based resource managers!

Snapshot configuration file

To configure a JSON snapshot, copy the following code to a file named snapshot.json in your container's folder.

Notes: Naming conventions

This file can be named anything you want but we suggest snapshot.json

{
    "fileType": "snapshot",
    "snapshots": [
        {
            "source": "gitConnector",
            "type": "git",
            "testUser": "<user-to-use-on-connector>",
            "branchName": "<branch-to-use-on-connector>",
            "nodes": [
                {
                    "snapshotId": "<snapshot-name>",
                    "type": "json",
                    "collection": "<collection-name>",
                    "path": "<relative-path-to-file>"
                }
            ]
        }
    ]
}

Remember to substitute all values in this file that looks like a <tag> such as:

tag What to put there
user-to-use-on-connector Same username as defined in the Git connector configuration file
branch-to-use-on-connector Same branch as defined in the Git connector configuration file
snapshot-name Name of the snapshot, you will use this in test files
collection-name Name of the MongoDB collection used to store snapshots of this file
relative-path-to-file Path to the file to read, relative to the root of the repository that the connector checks out