-
-
Notifications
You must be signed in to change notification settings - Fork 260
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
Upgrade expect-type; fix issues it reveals; add RenderingTestContext #1286
Conversation
@param {Object} context the context to setup for rendering | ||
@returns {Promise<Object>} resolves with the context that was setup | ||
@param {TestContext} context the context to setup for rendering | ||
@returns {Promise<RenderingTestContext>} resolves with the context that was setup |
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.
AFAICT no OSS code uses the value here. We could opt not to make it public.
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.
Seems good to export, actually: it moves us one step closer to not having everything depend on this.<whatever>
: even this.element
becomes unnecessary if you do this:
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit'; // transitively is this
import { render } from '@ember/test-helpers';
module('cool', function (hooks) {
let context = setupRenderingTest(hooks);
test('neato', assert function (assert) {
await render(<template>Hello!</template>);
assert(context.element.innerText.includes("Hello!"));
});
});
@param {Object} context the context to setup for rendering | ||
@returns {Promise<Object>} resolves with the context that was setup | ||
@param {TestContext} context the context to setup for rendering | ||
@returns {Promise<RenderingTestContext>} resolves with the context that was setup |
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.
Seems good to export, actually: it moves us one step closer to not having everything depend on this.<whatever>
: even this.element
becomes unnecessary if you do this:
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit'; // transitively is this
import { render } from '@ember/test-helpers';
module('cool', function (hooks) {
let context = setupRenderingTest(hooks);
test('neato', assert function (assert) {
await render(<template>Hello!</template>);
assert(context.element.innerText.includes("Hello!"));
});
});
This one will also need to have a merge or rebase! |
0c76569
to
3f42108
Compare
No description provided.