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

Chore: fix tests for Node 6+ #315

Merged
merged 1 commit into from
Feb 3, 2017
Merged

Chore: fix tests for Node 6+ #315

merged 1 commit into from
Feb 3, 2017

Conversation

not-an-aardvark
Copy link
Member

There are a few issues with the tests causing them to fail with Node 6 and above:

  • When parsing regular expression literals with the y and u flags, espree expected the value property of the resulting Literal node to null. However, since Node 6+ supports these flags, the value property was actually a regular expression with the corresponding flags. This commit updates the tests to conditionally expect a regex or null depending on whether the flags are supported in the current environment.
  • For invalid regular expressions with the u flag, Acorn outputs a different error message depending on whether the current environment supports the u flag. This commit updates the tests to conditionally expect a particular error message depending on whether the current environment supports the u flag.

There are a few issues with the tests causing them to fail with Node 6 and above:

* When parsing regular expression literals with the `y` and `u` flags, espree expected the `value` property of the resulting `Literal` node to `null`. However, since Node 6+ supports these flags, the `value` property was actually a regular expression with the corresponding flags. This commit updates the tests to conditionally expect a regex or `null` depending on whether the flags are supported in the current environment.
* For invalid regular expressions with the `u` flag, Acorn outputs a different error message depending on whether the current environment supports the `u` flag. This commit updates the tests to conditionally expect a particular error message depending on whether the current environment supports the `u` flag.
Copy link
Member

@mysticatea mysticatea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me!

@ilyavolodin ilyavolodin merged commit a3442b5 into master Feb 3, 2017
@not-an-aardvark not-an-aardvark deleted the fix-node-6-tests branch February 3, 2017 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants