forked from angular/angular-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdestroy.spec.js
37 lines (32 loc) · 1.05 KB
/
destroy.spec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
'use strict';
const ng = require('../helpers/ng');
const tmp = require('../helpers/tmp');
const SilentError = require('silent-error');
const expect = require('chai').expect;
describe('Acceptance: ng destroy', function () {
beforeEach(function () {
this.timeout(10000);
return tmp.setup('./tmp').then(function () {
process.chdir('./tmp');
}).then(function () {
return ng(['new', 'foo', '--skip-install']);
});
});
afterEach(function () {
return tmp.teardown('./tmp');
});
it('without args should fail', function () {
return ng(['destroy']).then(() => {
throw new SilentError('ng destroy should fail.');
}, (err) => {
expect(err.message).to.equal('The destroy command is not supported by Angular CLI.');
});
});
it('with args should fail', function () {
return ng(['destroy', 'something']).then(() => {
throw new SilentError('ng destroy something should fail.');
}, (err) => {
expect(err.message).to.equal('The destroy command is not supported by Angular CLI.');
});
});
});