Last 12 weeks · 0 commits
3 of 6 standards met
I have a failing unit test that, when used with via: In the above simplified example, I'm getting a 403. the only thing I care about is if the matches that of what the actual error is. But instead I get an 18,000 line message (it is actually longer) of the thing it is expecting. This is a gross overflow of information that nobody cares about and should be a simple 1 or 2 line of the following: Can this be simplified to valuable information?
Hello, I've been working on applying mutation testing to improve the reliability and robustness of the library, specifically focusing on how are handled and generated. Using the LLMorpheus tool, we identified a mutation in the configuration logic that was not eliminated by the existing tests. Issue Description: The current test suite checks the format of the variable after introducing it to the header, but it does not strictly perform such task. For example, if the line 105 of the file were changed from: to: Then an array can be introduced to the header's value. Such Array value can then pass the test on the line 438 of when compared to a string representation of the header values, because the loose equality check () in JavaScript coerces the types, which can lead to subtle bugs in production. Proposed Change: To address this, I suggest changing the assertion method from to in the file, specifically at line 444. This change would ensure that the tests verify not just the value but also the exact type of the header content, preventing type coercion issues. Impact:** This improvement would make the test suite more robust and ensure that similar type-related issues are caught during the testing phase, thus improving the overall reliability of the package. I believe that adopting stricter type checks in the tests will be beneficial for maintaining the high standards of code quality and reliability that characterizes your project. Looking forward to the team's thoughts on this proposal. Thank you for considering this enhancement.
Repository: tj/should.js. Description: BDD style assertions for node.js -- test framework agnostic Stars: 2738, Forks: 184. Primary language: JavaScript. Languages: JavaScript (100%). License: MIT. Open PRs: 1, open issues: 7. Last activity: 10y ago. Community health: 57%. Top contributors: tj, btd, rixth, aseemk, gabrielfalcao, TooTallNate, alsotang, travisjeffery, faridnsh, vlad-shatskyi and others.
should pass but is throwing an error when a custom message is passed. For Example: ({ firstName: "Luke", lastName: "Skywalker", occupation: "Jedi Master", favoriteBook: "The Force for Dummies" }).should.have.properties([ 'firstName', 'lastName', 'occupation', 'favoriteBook' ], "The dark side I sense in you."); Uncaught AssertionError: expected Object { firstName: 'Luke', lastName: 'Skywalker', occupation: 'Jedi Master', favoriteBook: 'The Force for Dummies' } to have properties Array [ 'firstName', 'lastName', 'occupation', 'favoriteBook' ] , 'The dark side I sense in you.' If you remove the custom error message it will pass as it should. Node.js v8.12.0 Should.js v11.2.1 This may be related to: https://github.com/tj/should.js/issues/228