File tree Expand file tree Collapse file tree 4 files changed +64
-0
lines changed Expand file tree Collapse file tree 4 files changed +64
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ module.exports = {
22
22
'serve' : require ( '../commands/serve' ) . default ,
23
23
'new' : require ( '../commands/new' ) . default ,
24
24
'generate' : require ( '../commands/generate' ) . default ,
25
+ 'destroy' : require ( '../commands/destroy' ) . default ,
25
26
'init' : require ( '../commands/init' ) . default ,
26
27
'test' : require ( '../commands/test' ) . default ,
27
28
'e2e' : require ( '../commands/e2e' ) . default ,
Original file line number Diff line number Diff line change
1
+ const Command = require ( 'ember-cli/lib/models/command' ) ;
2
+ const SilentError = require ( 'silent-error' ) ;
3
+
4
+
5
+ const DestroyCommand = Command . extend ( {
6
+ name : 'destroy' ,
7
+ aliases : [ 'd' ] ,
8
+ works : 'insideProject' ,
9
+
10
+ anonymousOptions : [
11
+ '<blueprint>'
12
+ ] ,
13
+
14
+ run : function ( ) {
15
+ return Promise . reject ( new SilentError ( 'The destroy command is not supported by Angular-CLI.' ) ) ;
16
+ }
17
+ } ) ;
18
+
19
+ export default DestroyCommand ;
20
+ DestroyCommand . overrideCore = true ;
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ const lookupCommand = require('ember-cli/lib/cli/lookup-command');
7
7
8
8
const commandsToIgnore = [
9
9
'easter-egg' ,
10
+ 'destroy' ,
10
11
'github-pages-deploy' // errors because there is no base github-pages command
11
12
] ;
12
13
Original file line number Diff line number Diff line change
1
+ 'use strict' ;
2
+
3
+ const ng = require ( '../helpers/ng' ) ;
4
+ const tmp = require ( '../helpers/tmp' ) ;
5
+ const conf = require ( 'ember-cli/tests/helpers/conf' ) ;
6
+ const SilentError = require ( 'silent-error' ) ;
7
+ const expect = require ( 'chai' ) . expect ;
8
+
9
+ describe ( 'Acceptance: ng destroy' , function ( ) {
10
+ before ( conf . setup ) ;
11
+
12
+ after ( conf . restore ) ;
13
+
14
+ beforeEach ( function ( ) {
15
+ this . timeout ( 10000 ) ;
16
+ return tmp . setup ( './tmp' ) . then ( function ( ) {
17
+ process . chdir ( './tmp' ) ;
18
+ } ) . then ( function ( ) {
19
+ return ng ( [ 'new' , 'foo' , '--skip-npm' , '--skip-bower' ] ) ;
20
+ } ) ;
21
+ } ) ;
22
+
23
+ afterEach ( function ( ) {
24
+ return tmp . teardown ( './tmp' ) ;
25
+ } ) ;
26
+
27
+ it ( 'without args should fail' , function ( ) {
28
+ return ng ( [ 'destroy' ] ) . then ( ( ) => {
29
+ throw new SilentError ( 'ng destroy should fail.' ) ;
30
+ } , ( err ) => {
31
+ expect ( err . message ) . to . equal ( 'The destroy command is not supported by Angular-CLI.' ) ;
32
+ } ) ;
33
+ } ) ;
34
+
35
+ it ( 'with args should fail' , function ( ) {
36
+ return ng ( [ 'destroy' , 'something' ] ) . then ( ( ) => {
37
+ throw new SilentError ( 'ng destroy something should fail.' ) ;
38
+ } , ( err ) => {
39
+ expect ( err . message ) . to . equal ( 'The destroy command is not supported by Angular-CLI.' ) ;
40
+ } ) ;
41
+ } ) ;
42
+ } ) ;
You can’t perform that action at this time.
0 commit comments