This package has been deprecated

Author message:

throwing this away. creating different one

@davehannon/netsuite-testing

1.0.2 • Public • Published

Netsuite-Testing

This will help testing of SuiteScript scripts

In order to make this work, you need to copy the contents of this into your project's node_modules directory.

I also use the following node modules:

  • app-module-path
  • amd-loader

Here is a sample test script:

var path = require('path')
require('app-module-path').addPath(path.join(__dirname, '..')) // adds project dir (running from @/test)
                                                               // to path, to use my custom module
const expect = require('chai').expect
if (typeof define !== 'function') { require('amd-loader') }
const Beebole_Customer_CS = require('../FLX_Beebole_Customer_CS.js')

describe('/Beebole_Customer_CS', function (done) {
  // Instantiate our module, passing in our dependencies
  var button = { isDisabled: true }
  const currentRecord = {
    getValue: function (a) {
      return a.fieldId
    },
    getField: function (id) {
      return button
    }
  }
  it('pageInit should enable button', function (done) {
    Beebole_Customer_CS.pageInit({ currentRecord: currentRecord })

    // Perform assertions
    expect(button.isDisabled).to.equal(false)
    done()
  })
})

Package Sidebar

Install

npm i @davehannon/netsuite-testing

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

23.6 kB

Total Files

14

Last publish

Collaborators

  • davehannon