alien4u
03/04/2019, 8:00 PMstalbert
03/04/2019, 8:02 PMtest('payload with same SKU on two lines should succeed', done => {
// after first run this one should be identified as a 'dupe' but still return 'SUCCESS'
const data = require('./payloads/EC_Restlet_eComm_RMAmultiplelines.json')
<http://http.post|http.post>({body: data, json: true, ...baseConfig}, function (e, r, body) {
console.debug(body)
expect(body.status).toEqual('SUCCESS')
done()
})
})
alien4u
03/04/2019, 8:03 PMstalbert
03/04/2019, 8:04 PMbaseConfig
is something like
/**
* OAuth config - replace <> placeholders with your values
*/
const oauth = {
// replace the values with your TBA consumer values from NS
consumer_key: 'foo',
consumer_secret: 'bar',
// replace with token TBA values from NetSuite
token: 'baz',
token_secret: 'bog',
realm: 'someaccount_SB2'
}
/**
* configuration used for passing to the node *request* object
*
* @example
* baseConfig.url = <https://path/to/restlet/endpoint
* <http://http.post|http.post>({body: payload, json: true, ...baseConfig}, function (e, r, body) { } )
*/
export const baseConfig = {
// EC_Restlet_PostEcomm_Order on DEV environment
url: 'path to restlet endpoint',
oauth: oauth
}
and the <http://http.post|http.post>()
is just the request
modulealien4u
03/04/2019, 8:05 PMstalbert
03/04/2019, 8:05 PMalien4u
03/04/2019, 8:05 PMstalbert
03/04/2019, 8:07 PMalien4u
03/04/2019, 8:20 PMvar code = {};
alien4u
03/04/2019, 8:20 PM