netsuite-testing
v1.0.10
Published
Module to simulate SuiteScript functions for testing purposes
Downloads
7
Maintainers
Readme
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()
})
})