Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Methods without corresponding tests #332

Closed
mhdawson opened this issue Sep 6, 2018 · 17 comments
Closed

Methods without corresponding tests #332

mhdawson opened this issue Sep 6, 2018 · 17 comments

Comments

@mhdawson
Copy link
Member

mhdawson commented Sep 6, 2018

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

@andrew-cc-chen
Copy link

andrew-cc-chen commented Sep 6, 2018

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)

@mhdawson
Copy link
Member Author

mhdawson commented Sep 26, 2018

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.

@NickNaso NickNaso added the test label Sep 27, 2018
yjaeseok added a commit to yjaeseok/node-addon-api that referenced this issue Oct 2, 2018
I would like to write tests fro array class.

ISSUE=nodejs#332
yjaeseok added a commit to yjaeseok/node-addon-api that referenced this issue Oct 2, 2018
I would like to write tests fro array class.

ISSUE=nodejs#332
@NickNaso
Copy link
Member

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

@github-actions
Copy link
Contributor

github-actions bot commented Mar 8, 2021

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.

@github-actions github-actions bot added the stale label Mar 8, 2021
@JoseExposito
Copy link
Contributor

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

@NickNaso
Copy link
Member

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

The PRs are #923 and #928

@mhdawson mhdawson removed the stale label Mar 12, 2021
@jschlight
Copy link
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

@NickNaso
Copy link
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.

@mhdawson
Copy link
Member Author

@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.

@JckXia
Copy link
Member

JckXia commented Mar 16, 2021

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.

@NickNaso
Copy link
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.

@JckXia
Copy link
Member

JckXia commented Mar 16, 2021

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

@github-actions
Copy link
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.

@github-actions github-actions bot added the stale label Jun 15, 2021
@mhdawson mhdawson removed the stale label Jun 16, 2021
@github-actions
Copy link
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.

@github-actions github-actions bot added the stale label Sep 15, 2021
@mhdawson
Copy link
Member Author

@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.

@JckXia
Copy link
Member

JckXia commented Sep 16, 2021

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

@mhdawson
Copy link
Member Author

@JckXia thanks for the quick response.

@nodejs nodejs deleted a comment from lam19892089 Nov 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants