Conversation
Perryvw
reviewed
May 5, 2019
test/unit/spreadElement.spec.ts
Outdated
| }; | ||
| const arr = [...it]; | ||
| return JSONStringify(arr)`; | ||
| expect(util.transpileAndExecute(code)).toBe(JSON.stringify([9, 8, 7, 6, 5, 4, 3, 2, 1, 0])); |
Member
There was a problem hiding this comment.
I think the other way around would be a bit nicer:
const result = util.transpileAndExecute(code);
expect(JSON.parse(result)).toEqual([9, 8, 7, 6, 5, 4, 3, 2, 1, 0]);
test/unit/spreadElement.spec.ts
Outdated
| return this; | ||
| }, | ||
| next() { | ||
| --this.i; |
Member
There was a problem hiding this comment.
I think making this just count up is a bit clearer, first time I looked at this test I thought it was bugged and reversed the order.
Collaborator
Author
There was a problem hiding this comment.
I usually do this on purpose to ensure we're not somehow getting array indicies instead of values.
Member
There was a problem hiding this comment.
I get that, but I'd sooner opt for adding a constant to each value, or multiplying them by 3 or something like that.
Collaborator
Author
There was a problem hiding this comment.
Ok, I'll do something different here
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #534