Skip to main content

Local test environment

As a developer, before you package your code to an npm package, you want to test it locally.

You can do that as follows. Assuming you have a Spec-Up-T installation running locally:

1. Open /package.json and look for the script section

  "scripts": {
"edit": "node -e \"require('spec-up-t')()\"",
"render": "node --no-warnings -e \"require('spec-up-t/index.js')({ nowatch: true })\"",
"dev": "node -e \"require('spec-up-t')({ dev: true })\"",
"collectExternalReferencesCache": "node --no-warnings -e \"require('spec-up-t/src/collect-external-references.js').collectExternalReferences({cache: true})\"",
"collectExternalReferencesNoCache": "node --no-warnings -e \"require('spec-up-t/src/collect-external-references.js').collectExternalReferences({cache: false})\"",
"topdf": "node -e \"require('spec-up-t/src/create-pdf.js')\"",
"freeze": "node -e \"require('spec-up-t/src/freeze.js')\"",
"references": "node -e \"require('spec-up-t/src/references.js')\"",
"help": "cat help.txt",
"menu": "bash ./main.sh",
"addremovexrefsource": "node --no-warnings -e \"require('spec-up-t/src/add-remove-xref-source.js')\"",
"configure": "node --no-warnings -e \"require('spec-up-t/src/configure.js')\"",
"postinstall": "node postinstall-message.js"
}

2. Find & Replace:

In the scripts section:

Find

'spec-up-t/

Replace it with:

'/Your/path/to/local/spec-up-t/repo/

where /Your/path/to/local/spec-up-t/repo/spec-up-t/spec-up-t should be the actual path on your machine.