-
Notifications
You must be signed in to change notification settings - Fork 6
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
add acceptance tests #27
Merged
Merged
Conversation
This file contains 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
…mber.run() also handles case where JSAPI is loaded before assertions are run
tomwayson
changed the title
add an acceptance test; get it to pass by wrapping load callback w/ E…
add an acceptance test that passes by wrapping load callback w/ Ember.run()
Aug 29, 2017
tests fail (sometimes) in odd ways: - `ember t` always seems to pass - `ember t -s` fails the first run with phantom showing: Global error: TypeError: undefined is not an object (evaluating '_qunit['default'].config.current.assert') at http://localhost:7357/assets/test-support.js, line 18229 JSHint | unit/services/esri-loader-test.js: global failure ✘ TypeError: undefined is not an object (evaluating '_qunit['default'].config.current.assert') http://localhost:7357/assets/test-support.js:18229 TypeError: undefined is not an object (evaluating '_qunit['default'].config.current.assert') at http://localhost:7357/assets/test-support.js, line 18229 and chrome showing: JSHint | unit/services/esri-loader-test.js: global failure (1, 0, 1) Uncaught TypeError: Cannot read property 'assert' of undefined - subsequent runs (pressing enter in console, saving a file, reloading chrome) fail consistently in phantom, but sometimes pass in chrome
also handles case where JSAPI is loaded before assertions are run
lot's of issues w/ this as it stands: - can't run more than one acceptance test (see comments) - phantom (only, not chrome) fails w/ Global error: Script error. at , line 0 JSHint | unit/services/esri-loader-test.js: global failure ✘ Script error. :0 Script error. at , line 0
phantom tests still blow up, but pass in Chrome (`ember t -s --launch=Chrome`) also, still have to skip the index acceptance test
mjuniper
approved these changes
Aug 30, 2017
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.
LGTM
… test this code is _very_ ugly, but it works will try to fix this upstream in esri-loader and remove the ugly hacks here
tomwayson
changed the title
add an acceptance test that passes by wrapping load callback w/ Ember.run()
[DNM] add an acceptance test that passes by wrapping load callback w/ Ember.run()
Aug 30, 2017
tomwayson
changed the title
[DNM] add an acceptance test that passes by wrapping load callback w/ Ember.run()
add acceptance tests
Aug 30, 2017
Also resolves #9 |
mjuniper
approved these changes
Aug 30, 2017
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.
LGTM
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.
While
ember t
,ember t -s
, andnpm test
all work with this there is a major limitation:We can't run more than one acceptance test b/c the application route's
renderTemplate()
gets called for each, which causes esri-loader to throw an "already loaded" error, which causes ember-cli-qunit to fail the test, even if that error is handled in acatch()
- are you f'ing kidding me?I've tried the suggested work arounds in that thread. Using
.then(() => {}, err => {})
instead of.catch()
didn't seem to work (perhaps b/c the underlying error is thrown and passed via callback instead of a promise?). I was able to overwriteEmber.Test.adapter.exception
, but it doesn't work for the first run ofember t -s
, only subsequent runs. Also it's 🦇 💩 crazy to do that for every acceptance test.Also, I suspect that we need to wrap this line in an
Ember.run()
as well, but that's just not exercised by this test.All that said, I'm PRing this code as is, b/c tests actually pass (on my machine, at least). I'll open another [DNM] PR (#28) that better demonstrates the above issues, but also introduces others.