-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Run tests in production #4223
Run tests in production #4223
Conversation
@pangratz do you mind rebasing this pr? |
import RecordReference from './references/record'; | ||
import BelongsToReference from './references/belongs-to'; | ||
import HasManyReference from './references/has-many'; | ||
import RecordReference from 'ember-data/-private/system/references/record'; |
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.
relative should work correctly, if it does not that is a bug in the build we need to fix.
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.
Sure thing. Let's wait until that is resolved, then I will rebase and remove this commit.
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.
It looks like this has been resolved with #4215 🎉
This test contains assertions for correctly rejected records in coalesced requests AND an assertion that a warning is logged. This commit splits the test into two: the first tests the correct behavior for rejected records and the second tests that the warning for missing records is logged. The splitting is necessary since in an upcoming commit the tests are run in production too: since in that environment tests which check for assertions are stripped, currently we would lose this test. That's why this test is split beforehand so the behavior is tested in production build as well.
This adds a `testInDebug` helper, which skips tests when run in production. This helper either runs the tests normally via QUnit.test if we are not in a production environment. If the test is executed within production however, QUnit.skip is used instead so the test is skipped. This allows us to skip tests which don't make sense in the production environment: this are tests which check for warnings and assertions thrown within code. Since those assertions/warnings are stripped from production code, it doesn't make sense to run those tests in that environment.
Thanks @pangratz |
This adds a new test helper
testInDebug
which executes a test viaQUnit.test
if we are not in theproduction
environment. If the tests are executed inproduction
environment though, then the test is skipped viaQUnit.skip
.The tests are now also run on TravisCI via
ember test --environment=production
.This addresses #4203.
TODO