-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
test: reduce brittleness of tab complete test #5772
Conversation
putIn.run(['.clear']); | ||
putIn.run(['var obj = {1:"a","1a":"b",a:"b"};']); | ||
|
||
testMe.complete('obj.', common.mustCall(function(error, data) { | ||
assert.deepEqual(data, obj_elements); | ||
assert.equal(data[0].indexOf('obj.1'), -1); | ||
assert.equal(data[0].indexOf('obj.1a'), -1); | ||
})); |
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.
Nit: maybe also check that obj.a
is there.
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.
Definitely, test added.
LGTM if CI is green. Left a nit that you can ignore if you want. |
I'd prefer strict equality checks in the test, but other than that, LGTM pending CI. |
test-repl-tab-complete includes tests that ensure that certain keys do not appear in tab completions or that completion does not crash the repl. It performed these tests by comparing completion output to a hardcoded list of expected keys. This list is made incorrect by any api changes that occur when new versions of V8 are introduced. With this change, we assert that the specific keys to be avoided are not present in the output instead.
@cjihrig Done. |
Failures on smartos14-64 seem unrelated. |
LGTM |
Re-running CI for SmartOS: https://ci.nodejs.org/job/node-test-commit-smartos/1758/ |
CI is green |
test-repl-tab-complete includes tests that ensure that certain keys do not appear in tab completions or that completion does not crash the repl. It performed these tests by comparing completion output to a hardcoded list of expected keys. This list is made incorrect by any api changes that occur when new versions of V8 are introduced. With this change, we assert that the specific keys to be avoided are not present in the output instead. PR-URL: #5772 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
Landed in 0eb3ed5 |
test-repl-tab-complete includes tests that ensure that certain keys do not appear in tab completions or that completion does not crash the repl. It performed these tests by comparing completion output to a hardcoded list of expected keys. This list is made incorrect by any api changes that occur when new versions of V8 are introduced. With this change, we assert that the specific keys to be avoided are not present in the output instead. PR-URL: #5772 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Conflicts: test/parallel/test-repl-tab-complete.js
This change relies on semver major changes... going to change to don't land for now, but open to it if someone wants to backport |
Pull Request check-list
Please make sure to review and check all of these items:
make -j8 test
(UNIX) orvcbuild test nosign
(Windows) pass withthis change (including linting)?
test (or a benchmark) included?
existing APIs, or introduces new ones)?
NOTE: these things are not required to open a PR and can be done
afterwards / while the PR is open.
Affected core subsystem(s)
Please provide affected core subsystem(s) (like buffer, cluster, crypto, etc)
test
Description of change
Please provide a description of the change here.
test-repl-tab-complete includes tests that ensure that certain keys do
not appear in tab completions or that completion does not crash the
repl. It performed these tests by comparing completion output to a
hardcoded list of expected keys. This list is made incorrect by any api
changes that occur when new versions of V8 are introduced.
With this change, we assert that the specific keys to be avoided are
not present in the output instead.