Giter VIP home page Giter VIP logo

netsumo's People

Contributors

benpf-pes avatar capitalbrandsjack avatar erikachang avatar lincecumhao avatar matthewwilson avatar paulclarkaranz avatar sergioramos avatar skromak avatar spiliot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

netsumo's Issues

Drop NS API incompatible implementations (SS2)?

PR #11 attempts to make getValue()/getText() API compatible, which raises the question if there's a need to keep the incompatible implementation (as the PR does)?

One reason to keep would be for simplicity when trying to access a value in the test (instead of passing verbose objects the API requests). I propose if there's indeed such need, to add special functions (i.e. _valueOfField('fieldName')) so we leave functions with only a concrete, public API compatible implementation.

To maintain backwards compatibility with existing tests, removing the incompatible implementation is better done with the next major version bump.

TypeError: Object.defineProperty called on non-object (TS compiled)

I've come across an issue when attempting to test typescript compiled code, seems like the code produced is not compatible. Do you have any recommendations to get around this?

Works:

/**
 * @NAPIVersion 2.0
 * @NScriptType UserEventScript
 */
define(["require", "exports", "N/log"], function (require, exports, log) {
    var beforeSubmit = function (context) {
        var x = context.newRecord.getValue({fieldId: "companyname"});
        log.audit("value", "companyname is: " + x);
    };

    return {
        beforeSubmit: beforeSubmit
    }
});

Fails:

/**
 * @NAPIVersion 2.0
 * @NScriptType UserEventScript
 */
define(["require", "exports", "N/log"], function (require, exports, log) {
    Object.defineProperty(exports, "__esModule", { value: true });     
     //=> Object.defineProperty called on non-object (exports is undefined) 

    exports.beforeSubmit = function (context) {
        var x = context.newRecord.getValue({ fieldId: "companyname" });
        log.audit("value", "companyname is: " + x);
    };
});

Specs:

  • netsumo 3.6.7
  • jest 23.6.0
  • nodejs 8.13.0
  • typescript 3.1.6
  • @hitc/netsuite-types 2018.2.6

tsconfig.json

  • "target": "es5",
  • "module": "amd",
  • "moduleResolution": "node",

NSearch create function is empty

The create(options) function of the NSearch module appears to be blank and does not do anything (line 67 in modules/SS2/NSearch).

superscript 1.0 plugin test

Hi thanks for your project, the document is really useful. However, I read the example about suitelet in suitescript 1.0. would you let me know if it worked on plugin , like email capture? would you mind let me know any example for testing?

Thanks

nlapiSubmitRecord bug

In nsContext.js, the function nlapiSubmitRecord checks the recordsArray for a record sharing the same ID as the record being submitted. A check is not made against type.
In NS, records of different types can share the same ID.

Expected behavior: I can submit a record with type 'customrecord_foo' and ID of 1, then submit a record of type 'customrecord_bar' with an ID of 1, and the recordsArray will have a length of 2.

Support SCA nlobjRequest, nlobjResponse and SC.Model Mocking

Will NetSumo support more NetSuite API objects in the future? For example; nlobjRequest, nlobjResponse and SC.Model? These are used alot in SuiteCommerce Advanced. http://suitecoder.appspot.com/static/api.html

I'm currently at the stage of testing my SCA Services (Foo.Service.ss files) and SCA Models (Foo.Model.js files). I need to pass a mock nlobjRequest to my service to test it and somehow get a mock nlobjResponse.

If there are no immediate plans to expand the library with these objects any advice on how I can create them to contribute to this repo? :)

TypeError: Cannot read property 'supressNlapiLogOutput' of undefined

FYI this looks like a quite promising NetSuite testing module :) Hope it keeps getting maintained as I'm sure to share this with other NS developers.

I'm following the NetSumo 'Getting Started' and trying to run the example suitelet test in my project. However I get an error when running the test:

C:\Users\MyProject>mocha

suitelet.js
#makeNetSuiteMagic
1) Adds a line item called My Magic Item and sets the quantity to 20

0 passing (31ms)
1 failing

  1. suitelet.js #makeNetSuiteMagic Adds a line item called My Magic Item and sets the quantity to 20:
    TypeError: Cannot read property 'supressNlapiLogOutput' of undefined
    at nlapiLogExecution (node_modules\netsumo\modules\nsContext.js:20:13)
    at Object.makeNetSuiteMagic (fileCabinet/suitelet.js:3:4)
    at Context. (test\suiteletTest.js:20:17)

I editted node_modules\netsumo\modules\nsContext.js and simply commented out the possibly undefined option supressNlapiLogOutput and it now works.

  var nlapiLogExecution = function(type,title,details) {
    //if(!opts.supressNlapiLogOutput) {
      console.log("TYPE: "+type+" | TITLE: "+title+" | DETAILS: "+details)
    //}
  }

Test runner

Hi, how can we run the tests. where can we get this app. Please give me the complete info about this. can we run this in our local systems. We want to unit test NetSuite 2.0 scripts.

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.