Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

test(jQuery): Run tests with jQuery 3 #14874

Closed
wants to merge 1 commit into from
Closed

Conversation

mgol
Copy link
Member

@mgol mgol commented Jul 6, 2016

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
A test update.

What is the current behavior? (You can also link to an open issue here)
Currently Angular is tested with jQuery 2.1 & 2.2. jQuery 2.2 is used for e2e tests.

What is the new behavior (if this is a feature change)?
Angular will be tested with jQuery 2.1, 2.2 & 3.0; the latest one will be used for e2e tests.

Does this PR introduce a breaking change?
No

Please check if the PR fulfills these requirements

Other information:

@mgol mgol added the type: test label Jul 6, 2016
@mgol mgol self-assigned this Jul 6, 2016
expect(element.val()).toBe(null);

// Cover both jQuery 3.x ([]) and 2.x (null) behavior.
var val = element.val();
Copy link
Contributor

Choose a reason for hiding this comment

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

How about toEqual(null || [])? Does that work?

Copy link
Member Author

Choose a reason for hiding this comment

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

toEqual(null || []) is the same as toEqual([]). :-) The expression will be computed before passing it to toEqual.

Copy link
Member

Choose a reason for hiding this comment

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

We have custom toBeOneOf() matcher. If we only had toEqualOneOf() 😛

@Narretz
Copy link
Contributor

Narretz commented Jul 6, 2016

Most of the data in the jquery karma conf could be moved into a shared file.
Otherwise LGTM

@Narretz Narretz added this to the 1.6.x milestone Jul 6, 2016
@gkalpak
Copy link
Member

gkalpak commented Jul 6, 2016

Looking at the travis logs, it seems that tests:jquery-2.2 ran 700 tests less that the other jquery versions. This doesn't seem to be the case on master. Any idea why?

@mgol
Copy link
Member Author

mgol commented Jul 6, 2016

@gkalpak Could you be more specific? I don't see such a divergence anywhere.

@gkalpak
Copy link
Member

gkalpak commented Jul 6, 2016

In the travis log of this PR's test:unit job I see:

jqLite: 42736 tests
jQuery (3.x): 42820 tests
jQuery-2.2: 42120 tests
jQuery-2.1: 42820 tests

(Different number of tests for jQuery (3.x)/jQuery-2.1 vs jQuery-2.2.)

In the travis log of the latest master build's test:unit job I see:

jqLite: 41660 tests
jQuery (2.2): 42884 tests
jQuery-2.1: 42884 tests

(Same number of tests for jQuery (2.2) vs jQuery-2.1.)

@mgol mgol changed the title test(jQuery): Run tests with jQuery 3.0 test(jQuery): Run tests with jQuery 3 Jul 11, 2016
@mgol
Copy link
Member Author

mgol commented Jul 11, 2016

@gkalpak These results are weird. I updated jQuery to 3.1.0 and rebased my PR and now the numbers don't diverge that much; in particular, jQuery 2.1 has the same number of tests run as jQuery 2.2). On the other hand, on one of the commits on master I see 42794 tests run on jQuery 2.2 but only 39294 on jQuery 2.1.

It seems like some of the tests was being skipped by random (or the total sum is being calculated incorrectly).

In any case, this doesn't seem related to changes in this PR.

@gkalpak
Copy link
Member

gkalpak commented Jul 12, 2016

It seems like some of the tests was being skipped by random (or the total sum is being calculated incorrectly).

I hope it is the latter. It will be very worrying, if it is the former 😟

@gkalpak
Copy link
Member

gkalpak commented Jul 12, 2016

After comparing a couple of master builds, it turns out that the diviations are all related to Safari (for which the total number of tests are always reported as 0 as well). There is obviously some issue with Safari (or some Safari launcher/adapter) wrt to test counts.

In any case, not related to this PR as you said.

LGTM

@mgol
Copy link
Member Author

mgol commented Jul 13, 2016

Most of the data in the jquery karma conf could be moved into a shared file.

I extracted the shared parts.

@mgol mgol closed this in 859b1e3 Jul 13, 2016
@mgol mgol deleted the jquery-3 branch July 13, 2016 08:09
mgol added a commit that referenced this pull request Jul 13, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants