Documentation needed for new module-for-acceptance
See original GitHub issueBefore ember v3 we had module-for-acceptance file, in it I could declare default beforeEach and afterEach hooks for all my application tests:
import QUnit from 'qunit';
import { resolve } from 'rsvp';
import startApp from '../helpers/start-app';
import destroyApp from './destroy-app';
export default function(name, options = {}) {
QUnit.module(name, {
beforeEach() {
window.localStorage.clear();
Object.keys(window.Cookies.get()).forEach((cookieName) => window.Cookies.remove(cookieName));
this.application = startApp();
if (options.beforeEach) {
return options.beforeEach.apply(this, arguments);
}
},
afterEach() {
window.localStorage.clear();
Object.keys(window.Cookies.get()).forEach((cookieName) => window.Cookies.remove(cookieName));
let afterEach = options.afterEach && options.afterEach.apply(this, arguments);
return resolve(afterEach).then(() => destroyApp(this.application));
}
});
}
now we dont have such functionality so I dont know how to extend setupApplicationTest(hooks), with cache clears.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Acceptance Tests - Ember Guides
moduleForAcceptance deals with application setup and teardown. The last few lines, within the function test , contain an example test.
Read more >Modules And Helpers - Codeception Docs
There is the WebDriver module for acceptance testing, modules for all popular PHP frameworks, PHPBrowser to emulate browser execution, REST for testing APIs ......
Read more >Force Development and Documentation Consolidated ...
Basis of issue plans are requirements documents. BOIPs support equipment acquisition and materiel development by identifying and documenting ...
Read more >How to use a service from an acceptance test in Ember.js
import moduleForAcceptance from 'super-rentals/tests/helpers/module-for-acceptance'; import Service from '@ember/service';
Read more >Test helpers - Ember Power Select
To use those helpers in acceptance tests that use moduleForAcceptance , you need to ... However if you are using the new testing...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@sbrichards, I was able to accomplish this just now by adding
tests/helpers/setup-application-test.js
with my previousdestroy-app
code:Then instead of importing
setupApplicationTest
fromember-qunit
in each test file, I import my overridden version.yes this is not a global module extension, I already used these. The issue is some of my hooks are very repetitive when I write them for every module. module-for-acceptance.js used to replace QUnit module() with predefined beforeEach, afterEach logic. Could we reopen this?