GithubHelp home page GithubHelp logo

devnetkc / netsuite-cust-jest-stubs-template Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 780 KB

Template for creating an npm package for your custom NetSuite stubs

License: MIT License

JavaScript 95.74% Shell 4.26%
custom-module custom-modules jest jest-test modules netsuite netsuite-api npm npm-package stub stubs stubs-only template templates

netsuite-cust-jest-stubs-template's Introduction

Introduction

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 the NetSuite-CustomModules-Template tutorial/template project.

๐ŸŽ‰ Getting Started

  1. Open ./package.json and customize the project configuration
  2. Run npm i to install project dependencies
  3. Add your module path aliases to customJestStubs.js
  4. Create a local environment variable NPM_TOKEN using your NPM token for the value
  5. Publish your npm package using npm 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

Use npm run <script> to execute various commands for the project

  • npm run docs -- Generates project documentation based on JSDoc notations (Configure with docsMD.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 your jest.config.js to map this module from the stub pkg to your local project if it is available. See project jest.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

Param Type Description
query Object NS query module
log Object NS log module

aModule.GetVendorPrefix(vendorId) โ‡’ String

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

Kind: static method of aModule

Param Type Description
vendorId String Entity ID of vendor Ex: 4321

aModule.RunQuery(vendorId) โ‡’ String

Returns query result of vendor prefix from vendor record

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

Param Type Description
vendorId String Vendor 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

Param Type Description
log Object NS log module

bModule.set_CustomFieldValue(options) โ‡’ undefined

Example set custom body field value for record

Kind: static method of bModule

Param Type Description
options Object Object of parameters for setting custom body field
options.currentRecord Record NS Record Object to update
options.fieldId String Field id on record object to update value on
options.value String Value to set record field to

Happy Coding! ๐Ÿฅณ

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.