-
Notifications
You must be signed in to change notification settings - Fork 89
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
Undefined error when using mocha's before
#216
Comments
Thanks for reporting the error, I'll take a look at it. I don't use mocha with ember a lot, so I'm not too familiar with what changes when calling |
Thanks for the quick reply! I'm embarrassed I didn't try the global helper myself, seems an obvious test now. I'm seeing the same issue with trying to use the global Any recommendations as to the right project to report this issue? |
@SaladFork I would say that you should open an issue in ember-mocha rather than opening it in ember-cli-mocha to ask if this is an expected behavior or not. Reading about Mocha's hooks it kind of make sense that these helpers don't exist on the Remember that when an application is instantiated, it registers all the test helpers in the global context (in the window object). |
Thanks @san650! Unless I'm misunderstanding, a common pattern in Mocha is to nest describe('Some acceptance test', function() {
let application;
beforeEach(function() {
application = startApp();
});
afterEach(function() {
destroyApp(application);
});
context('The main page', function() {
// No need for `beforeEach` here as we're not changing the page between the below tests,
// but do want to have each `it` block test only a single thing.
before(function() {
MainPageObject.visit();
});
it('should have some value on the page', function() {
// ...
});
it('should have another value on the page', function() {
// ...
});
});
}); Thanks again! |
@SaladFork Indeed I think you're misunderstanding. The I've taken your example and put some
|
Error is thrown at visitable.js:95.
Using:
ember-cli-page-object@1.4.2
ember-cli-mocha@0.10.4
ember-mocha-adapter#0.3.1
mocha#2.5.3
chai#3.5.0
The text was updated successfully, but these errors were encountered: