Functions/New-NodePackageDetails.Tests.ps1

describe "BitTitan.Runbooks.Common/New-NodePackageDetails" -Tag "module", "unit" {

    # Import the function to test
    . "$($PSScriptRoot)\New-NodePackageDetails.ps1"

    it "returns a json string containing the Node package details" {
        # Call the function
        $output = New-NodePackageDetails -Name "Node Package Name" -Description "This is a test Node package."

        # Verify the output
        $output | Should Be @"
{
    "scripts": {
                    "test": "echo \u0027Error: no test specified\u0027 \u0026\u0026 exit 1"
                },
    "description": "This is a test Node package.",
    "dependencies": {
                         "puppeteer": "1.4.0"
                     },
    "version": "1.0.0",
    "private": true,
    "author": "BitTitan",
    "name": "Node Package Name",
    "main": "Node Package Name.js",
    "license": "ISC"
}
"@

    }
}