-
-
Notifications
You must be signed in to change notification settings - Fork 834
feat: add assert/has-same-constructor
#5446
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
base: develop
Are you sure you want to change the base?
Conversation
--- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na ---
Coverage Report
The above coverage report was generated for the changes in this PR. |
--- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: passed - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: failed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: passed - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: failed ---
/stdlib lint-autofix |
@abhishekblue Thanks for working on this issue. That looks like a good starting point. The first step here is to ensure that every comment in this PR has been addressed in this one. Also, other similar packages in Can you also change the title to: feat: add |
This will also resolve the CI failures you're currently experiencing. |
t.end(); | ||
}); | ||
|
||
tape( 'compare two null values', function test( t ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test descriptions in this file should be more descriptive and follow project's code conventions. Looking at other packages would be useful to fix this.
* // returns true | ||
* | ||
*/ | ||
|
||
function hasSameConstructor( x, y ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* // returns true | |
* | |
*/ | |
function hasSameConstructor( x, y ) { | |
* // returns true | |
*/ | |
function hasSameConstructor( x, y ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure you are following correct spacing conventions throughout this PR.
--- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: failed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: passed ---
--- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: passed - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: failed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: passed - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: failed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: passed - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: failed ---
@Neerajpathak07 @anandkaranubc, I’ve been working on this PR but I’m struggling to pass the tests despite multiple attempts. Could you please provide some guidance or point me to resources that might help me resolve these issues? I’d really appreciate your support. Thanks! |
@@ -30,8 +30,10 @@ | |||
"bugs": { | |||
"url": "https://github.com/stdlib-js/stdlib/issues" | |||
}, | |||
"dependencies": {}, | |||
"devDependencies": {}, | |||
"dependencies": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In absolutely no circumstances should you be editing this file in this PR. These dependencies should be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I must've accidentally edited this file. Apologies for this!
}); | ||
|
||
tape( 'the function returns `true` if provided two arguments which have the same constructor', function test ( t ) { | ||
var values; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make sure you have installed and setup EditorConfig. You have mixed tabs and spaces throughout this file. You can find more instructions in our contributing and development guides.
var bool; | ||
var i; | ||
|
||
values =[ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to rethink these tests. Testing built-in primitives isn't particularly interesting. The entire purpose of this API is to determine whether two class instances share the same original constructor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kgryte, thank you for your feedback. To confirm, should I create custom classes and their constructors and run tests specifically on those constructors to determine whether class instances share the same original constructor? Just want to be sure before proceeding further.
* // returns true | ||
*/ | ||
function hasSameConstructor( x, y ) { | ||
if ( x === null || y === null ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about undefined
?
assert/has-same-constructor
type: pre_push_report
description: Results of running various checks prior to pushing changes. report:
Resolves #815.
Description
This pull request:
hasSameConstructor
utility to the@stdlib/assert/
namespace to test if two values have the same constructor.Related Issues
This pull request:
@stdlib/assert/has-same-constructor
#815Questions
No.
Other
No.
Checklist
@stdlib-js/reviewers