Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Template for creating an npm package for your custom NetSuite stubs

License

NotificationsYou must be signed in to change notification settings

devnetkc/NetSuite-Cust-Jest-Stubs-Template

Repository files navigation

This project is meant to serve as a baseline template project for getting tests implemented easier in to your NetSuite projects. Use these stubs for modules which are imported to other NetSuite SuiteCloud projects.

Using the directory path/SuiteScript/..., we can provide aliases locally for these modules while still being available in NetSuite -- as the root directory for SuiteScript files in NetSuite is/SuiteScripts/.

This project pairs with theNetSuite-CustomModules-Template tutorial/template project.

🎉 Getting Started

  1. Open./package.json and customize the project configuration
  2. Runnpm i to install project dependencies
  3. Add your module path aliases tocustomJestStubs.js
  4. Create a local environment variableNPM_TOKEN using your NPM token for the value
  5. Publish your npm package usingnpm publish

🧐 Notable Files

  • README.hbs -- Base template file the project README.md is generated from
  • npmrc -- NPM environment token loader file for publishing project
  • docsMD.config -- Wiki MD generator from JSDoc notations
  • jsDocsConf.json -- JSDocs configuration file

🔨 Scripts

Usenpm run <script> to execute various commands for the project

  • npm run docs -- Generates project documentation based on JSDoc notations (Configure withdocsMD.config &&jsDocsConf.json)
  • npm run open-docs -- Opens documentation in browser for viewing

👷 CI/CD

Azure yaml pipeline files are provided in.ci/workflows.

Modules

aModule

Your custom NetSuite module A

bModule

Your custom NetSuite module B

aModule

Your custom NetSuite module A

Summary: This is example stub of custom NetSuite module A. It may or may not be in your SuiteCloud project.Update yourjest.config.js to map this module from the stub pkg to your local project if it is available.See projectjest.config.js for further examples of this.
Format:
Napiversion: 2.1
Since: 2022.2
Version: 1.0.0
License: NApiVersion

aModule(query, log) ⏏

NetSuite module A export function

Kind: Exported function

ParamTypeDescription
queryObjectNS query module
logObjectNS log module

aModule.GetVendorPrefix(vendorId) ⇒String

Returns preferred vendor prefix from record or blank if no prefix is located

Kind: static method ofaModule

ParamTypeDescription
vendorIdStringEntity ID of vendor Ex:4321

aModule.RunQuery(vendorId) ⇒String

Returns query result of vendor prefix from vendor record

Kind: static method ofaModule
Returns:String - - Returns vendor prefix string from query result
Access: protected

ParamTypeDescription
vendorIdStringVendor entity ID to run query on

bModule

Your custom NetSuite module B

Format:
Napiversion: 2.1
Since: 2022.2
Version: 1.0.0
License: NApiVersion

bModule(log) ⏏

NetSuite module B export function

Kind: Exported function

ParamTypeDescription
logObjectNS log module

bModule.set_CustomFieldValue(options) ⇒undefined

Example set custom body field value for record

Kind: static method ofbModule

ParamTypeDescription
optionsObjectObject of parameters for setting custom body field
options.currentRecordRecordNS Record Object to update
options.fieldIdStringField id on record object to update value on
options.valueStringValue to set record field to

Happy Coding! 🥳


[8]ページ先頭

©2009-2025 Movatter.jp