Skip to content

Methods without corresponding tests #332

Closed

Description

@mhdawson

Need to document then list of methods that still need tests.

Activity

  1. kebahpng commented on Sep 6, 2018

    @kebahpng
    class methods
    Function Function()
    Value Call(size_t argc, const napi_value* args) const
    Value Call(napi_value recv, size_t argc, const napi_value* args) const
    Value MakeCallback(napi_value recv, const std::initializer_list<napi_value>& args) const
    Value MakeCallback(napi_value recv, const std::vector<napi_value>& args) const
    Value MakeCallback(napi_value recv, size_t argc, const napi_value* args) const
    Object New(size_t argc, const napi_value* args) const
    Object Object()
    Object(napi_env env, napi_value value)
    PropertyLValuestd::string operator [](const char* utf8name)
    PropertyLValuestd::string operator [](const std::string& utf8name)
    PropertyLValue<uint32_t> operator [](uint32_t index)
    Value operator [](const char* utf8name) const
    Value operator [](const std::string& utf8name) const
    Value operator [](uint32_t index) const
    bool Has(uint32_t index) const
    Value Get(uint32_t index) const
    template void Set(uint32_t index, const ValueType& value)
    bool Delete(uint32_t index)
    void DefineProperties(const std::vector& properties)
    bool InstanceOf(const Function& constructor) const
    Object::PropertyLValue operator Value() const
    template PropertyLValue& operator =(ValueType value)
    Number See PR #355 Number()
    See PR #355 Number(napi_env env, napi_value value)
    See PR #355 operator int32_t() const
    See PR #355 operator uint32_t() const
    See PR #355 operator int64_t() const
    See PR #355 operator float() const
    See PR #355 operator double() const
    Value Value(napi_env env, napi_value value)
    template static Value From(napi_env env, const T& value)
    operator napi_value() const
    bool operator ==(const Value& other) const
    bool operator !=(const Value& other) const
    bool StrictEquals(const Value& other) const
    Napi::Env Env() const
    bool IsEmpty() const
    Boolean See PR #354 Boolean()
    See PR #354 Boolean(napi_env env, napi_value value)
    See PR #490 operator bool() const
    See PR #354 bool Value() const
    External External()
    External(napi_env env, napi_value value)
    Symbol static Symbol New(napi_env env, const std::string& description)
    static Symbol New(napi_env env, napi_value description)
    Symbol()
    Symbol(napi_env env, napi_value value)
    DataView DataView()
    DataView(napi_env env, napi_value value)
    void* Data() const
    Array static Array New(napi_env env, size_t length)
    Array()
    Array(napi_env env, napi_value value)
    uint32_t Length() const
    ArrayBuffer ArrayBuffer(napi_env env, napi_value value)
    TypedArray TypedArray()
    TypedArray(napi_env env, napi_value value)
    uint8_t ElementSize() const
    size_t ByteOffset() const
    size_t ByteLength() const
    TypedArray(napi_env env, napi_value value, napi_typedarray_type type, size_t length)
    napi_typedarray_type TypedArrayTypeForPrimitiveType()
    TypedArrayOf TypedArrayOf()
    TypedArrayOf(napi_env env, napi_value value)
    T& operator [](size_t index)
    const T& operator [](size_t index) const
    T* Data()
    const T* Data() const
    Error static Error New(napi_env env)
    Error()
    Error(napi_env env, napi_value value)
    Error(Error&& other)
    Error& operator =(Error&& other)
    Error(const Error&)
    Error& operator =(Error&)
    const char* what() const NAPI_NOEXCEPT override
    typedef napi_status (create_error_fn)(napi_env envb, napi_value code, napi_value msg, napi_value result)
    template static TError New(napi_env env, const char* message, size_t length, create_error_fn create_error)
    TypeError static TypeError New(napi_env env, const char* message)
    TypeError()
    TypeError(napi_env env, napi_value value)
    RangeError static RangeError New(napi_env env, const char* message)
    RangeError()
    RangeError(napi_env env, napi_value value)
    Buffer Buffer()
    Buffer(napi_env env, napi_value value)
    String static String New(napi_env env, const std::u16string& value)
    template static String From(napi_env env, const T& value)
    String()
    String(napi_env env, napi_value value)
    operator std::string() const
    operator std::u16string() const
    PropertyDescriptor static PropertyDescriptor Accessor(napi_value name, Getter getter, ......)
    static PropertyDescriptor Accessor(napi_value name, Getter getter, Setter setter, ......)
    static PropertyDescriptor Function(napi_value name, Callable cb, ......)
    static PropertyDescriptor Value(napi_value name, napi_value value, napi_property_attributes attributes = napi_default)
    PropertyDescriptor(napi_property_descriptor desc)
    operator napi_property_descriptor&()
    operator const napi_property_descriptor&() const
    ClassPropertyDescriptor ClassPropertyDescriptor(napi_property_descriptor desc)
    operator napi_property_descriptor&()
    operator const napi_property_descriptor&() const
    AsyncWorker AsyncWorker(AsyncWorker&& other)
    AsyncWorker& operator =(AsyncWorker&& other)
    AsyncWorker(const AsyncWorker&)
    AsyncWorker& operator =(AsyncWorker&)
    operator napi_async_work() const
    Napi::Env Env() const
    void Cancel()
    FunctionReference& Callback()
    explicit AsyncWorker(const Function& callback)
    explicit AsyncWorker(const Function& callback, const char* resource_name)
    explicit AsyncWorker(const Object& receiver, const Function& callback)
    explicit AsyncWorker(const Object& receiver, const Function& callback, const char* resource_name)
    explicit AsyncWorker(const Object& receiver, const Function& callback, const char* resource_name, const Object& resource)
    virtual void Execute()
    virtual void OnOK()
    virtual void OnError(const Error& e)
    Reference Reference()
    Reference(napi_env env, napi_ref ref)
    Reference(Reference&& other)
    Reference& operator =(Reference&& other)
    Reference& operator =(Reference&)
    operator napi_ref() const
    bool operator ==(const Reference &other) const
    bool operator !=(const Reference &other) const
    Napi::Env Env() const
    void Reset()
    void Reset(const T& value, uint32_t refcount = 0)
    Reference(const Reference&)
    ObjectReference ObjectReference()
    ObjectReference(napi_env env, napi_ref ref)
    ObjectReference(Reference&& other)
    ObjectReference& operator =(Reference&& other)
    ObjectReference(ObjectReference&& other)
    ObjectReference& operator =(ObjectReference&& other)
    ObjectReference& operator =(ObjectReference&)
    Napi::Value Get(const std::string& utf8name) const
    void Set(const char* utf8name, napi_value value)
    void Set(const char* utf8name, double numberValue)
    void Set(const std::string& utf8name, napi_value value)
    void Set(const std::string& utf8name, Napi::Value value)
    void Set(const std::string& utf8name, std::string& utf8value)
    void Set(const std::string& utf8name, bool boolValue)
    void Set(const std::string& utf8name, double numberValue)
    void Set(uint32_t index, const napi_value value)
    void Set(uint32_t index, const Napi::Value value)
    void Set(uint32_t index, const std::string& utf8value)
    void Set(uint32_t index, bool boolValue)
    void Set(uint32_t index, double numberValue)
    ObjectReference(const ObjectReference&)
    FunctionReference FunctionReference(napi_env env, napi_ref ref)
    FunctionReference(Reference&& other)
    FunctionReference& operator =(Reference&& other)
    FunctionReference(FunctionReference&& other)
    FunctionReference& operator =(FunctionReference&& other)
    FunctionReference(const FunctionReference&) = delete
    FunctionReference& operator =(FunctionReference&) = delete
    Napi::Value Call(const std::initializer_list<napi_value>& args) const
    Napi::Value Call(const std::vector<napi_value>& args) const
    Napi::Value Call(napi_value recv, const std::initializer_list<napi_value>& args) const
    Napi::Value Call(napi_value recv, const std::vector<napi_value>& args) const
    Napi::Value MakeCallback(napi_value recv, const std::initializer_list<napi_value>& args) const
    Napi::Value MakeCallback(napi_value recv, const std::vector<napi_value>& args) const
    Object New(const std::vector<napi_value>& args) const
    HandleScope HandleScope(napi_env env, napi_handle_scope scope)
    operator napi_handle_scope() const
    Napi::Env Env() const
    EscapableHandleScope operator napi_escapable_handle_scope() const
    Napi::Env Env() const
    Value Escape(napi_value escapee)
    ObjectWrap static T* Unwrap(Object wrapper)
    typedef void (*StaticVoidMethodCallback)(const CallbackInfo& info)
    typedef Napi::Value (*StaticMethodCallback)(const CallbackInfo& info)
    typedef Napi::Value (*StaticGetterCallback)(const CallbackInfo& info)
    typedef void (*StaticSetterCallback)(const CallbackInfo& info, const Napi::Value& value)
    typedef void (T::*InstanceVoidMethodCallback)(const CallbackInfo& info)
    typedef Napi::Value (T::*InstanceMethodCallback)(const CallbackInfo& info)
    typedef Napi::Value (T::*InstanceGetterCallback)(const CallbackInfo& info)
    typedef void (T::*InstanceSetterCallback)(const CallbackInfo& info, const Napi::Value& value)
    typedef ClassPropertyDescriptor PropertyDescriptor
    static Function DefineClass(Napi::Env env, const char* utf8name, const std::vector& properties, ......)
    static PropertyDescriptor StaticMethod(const char* utf8name, StaticVoidMethodCallback method, ......)
    static PropertyDescriptor StaticMethod(const char* utf8name, StaticMethodCallback method, ......)
    static PropertyDescriptor StaticAccessor(const char* utf8name, StaticGetterCallback getter, StaticSetterCallback setter, ......)
    static PropertyDescriptor InstanceMethod(Symbol name, InstanceVoidMethodCallback method, ......)
    static PropertyDescriptor StaticValue(const char* utf8name, Napi::Value value, ......)
    static PropertyDescriptor InstanceValue(const char* utf8name, Napi::Value value, ......)
    Promise::Deferred Deferred(napi_env env)
    CallbackInfo CallbackInfo(napi_env env, napi_callback_info info)
    CallbackInfo(CallbackInfo const &)
    void operator=(CallbackInfo const &)
    Value NewTarget() const
    size_t Length() const
    const Value operator [](size_t index) const
    Value This() const
    void SetData(void* data)
    Env Env(napi_env env)
    operator napi_env() const
    Object Global() const
    Value Undefined() const
    Value Null() const
    global template Reference Weak(T value)
    FunctionReference Weak(Function value)
    template Reference Persistent(T value)
  2. mhdawson commented on Sep 26, 2018

    @mhdawson
    MemberAuthor

    From work that @andrew-cc-chen has done, this looks like the current coverage:

    node-addon-api-coverage.pdf

    Its not as good as the html view in that it does not show the function name being covered.

  3. NickNaso commented on Aug 26, 2019

    @NickNaso
    Member

    Hi everybody,
    I'm working on two PRs to add test for Napi::Value and Napi::String.

  4. github-actions commented on Mar 8, 2021

    @github-actions
    Contributor

    This issue is stale because it has been open many days with no activity. It will be closed soon unless the stale label is removed or a comment is made.

  5. JoseExposito commented on Mar 10, 2021

    @JoseExposito
    Contributor

    I submitted a couple of PRs adding missing test for Object and Function.

  6. NickNaso commented on Mar 12, 2021

    @NickNaso
    Member

    I submitted a couple of PRs adding missing test for Object and Function.

    The PRs are #923 and #928

  7. jschlight commented on Mar 16, 2021

    @jschlight
    Contributor

    @mhdawson Jack needs to be able to update the table in the comment above for the work he's doing for the project.

    I think it makes sense to transfer the table into a test-coverage.md file that's stored in the repository so that changes can be made and tracked using PRs. A couple of questions:

    • Does it make sense to create a test-coverage.md file?
    • Where's the best place to put the file? It could be the project root, doc, or test.

    I'm happy to make whatever change we decide on.

    If we decide to keep it simple and continue to maintain the information on the table above, Jack will need write access to this issue.

    @JckXia

  8. NickNaso commented on Mar 16, 2021

    @NickNaso
    Member

    Hi @jschlight,
    I think that could be more appropriate create separate issues for every class item in the table es. global env and track all the work in those issues.
    In terms of documentation we need to add a guid on how to add a new test case.
    About the coverage we should use some tools to create a report for the coverage.

  9. mhdawson commented on Mar 16, 2021

    @mhdawson
    MemberAuthor

    @NickNaso suggestion will address the issue. As the originator of the new issues Jack will be able to edit them as well. So maybe close the existing one and he can open a new set of issues to cover the work.

  10. JckXia commented on Mar 16, 2021

    @JckXia
    Member

    Okay thanks everyone, just to make sure, would I need open a new issue per each class (i.e separate issues for Objects, Functions, Buffer, String etc?) I'm just wondering if it will clog up the issue tracker as there exists around 20+ classes.

  11. NickNaso commented on Mar 16, 2021

    @NickNaso
    Member

    Hi @JckXia,
    I think you can proceed. My advice is to tag the issue you created with the test tag. If you cannot able to do that I can do it for you after you crated the issue.

  12. JckXia commented on Mar 16, 2021

    @JckXia
    Member

    @NickNaso Okay thank you! Yeah it looks like I can't tag the issues. Will create the set of issues after work today.

  13. github-actions commented on Jun 15, 2021

    @github-actions
    Contributor

    This issue is stale because it has been open many days with no activity. It will be closed soon unless the stale label is removed or a comment is made.

  14. github-actions commented on Sep 15, 2021

    @github-actions
    Contributor

    This issue is stale because it has been open many days with no activity. It will be closed soon unless the stale label is removed or a comment is made.

  15. mhdawson commented on Sep 16, 2021

    @mhdawson
    MemberAuthor

    @JckXia do we still need this issue or is it replace by the other issues you created? If yes then I'll close this issue.

  16. JckXia commented on Sep 16, 2021

    @JckXia
    Member

    Hey @mhdawson , I think we can close this issue.

  17. mhdawson commented on Sep 16, 2021

    @mhdawson
    MemberAuthor

    @JckXia thanks for the quick response.

  18. deleted a comment from lam19892089 on Nov 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions