File tree Expand file tree Collapse file tree 3 files changed +37
-0
lines changed
Expand file tree Collapse file tree 3 files changed +37
-0
lines changed Original file line number Diff line number Diff line change 1+ import { registerAsyncHelper } from '@ember/test' ;
2+
3+ export default registerAsyncHelper ( '<%= camelizedModuleName %>' , function ( app ) {
4+
5+ } ) ;
Original file line number Diff line number Diff line change 1+ 'use strict' ;
2+
3+ module . exports = {
4+ description : 'Generates a test helper.'
5+ } ;
Original file line number Diff line number Diff line change 1+ 'use strict' ;
2+
3+ const blueprintHelpers = require ( 'ember-cli-blueprint-test-helpers/helpers' ) ;
4+ const setupTestHooks = blueprintHelpers . setupTestHooks ;
5+ const emberNew = blueprintHelpers . emberNew ;
6+ const emberGenerateDestroy = blueprintHelpers . emberGenerateDestroy ;
7+
8+ const chai = require ( 'ember-cli-blueprint-test-helpers/chai' ) ;
9+ const expect = chai . expect ;
10+
11+ describe ( 'Blueprint: test-helper' , function ( ) {
12+ setupTestHooks ( this ) ;
13+
14+ describe ( 'in app' , function ( ) {
15+ beforeEach ( function ( ) {
16+ return emberNew ( ) ;
17+ } ) ;
18+
19+ it ( 'test-helper foo' , function ( ) {
20+ return emberGenerateDestroy ( [ 'test-helper' , 'foo' ] , _file => {
21+ expect ( _file ( 'tests/helpers/foo.ts' ) )
22+ . to . contain ( "import { registerAsyncHelper } from '@ember/test';" )
23+ . to . contain ( "export default registerAsyncHelper('foo', function(app) {\n\n}" ) ;
24+ } ) ;
25+ } ) ;
26+ } ) ;
27+ } ) ;
You can’t perform that action at this time.
0 commit comments