-
Notifications
You must be signed in to change notification settings - Fork 147
/
Copy pathcliAccessibility.js
32 lines (29 loc) · 1018 Bytes
/
cliAccessibility.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
const expect = require('unexpected');
const spawn = require('cross-spawn');
describe('Test command line interface functionality', () => {
describe('CLI accessibility', () => {
it('`create-elm-app` command should be available', () => {
const { output, status } = spawn.sync('create-elm-app');
expect(
output.toString(),
'to contain',
'Usage: create-elm-app <project-directory>'
);
expect(status, 'to be', 1);
});
it('`elm-app` command should be available', () => {
const { output, status } = spawn.sync('elm-app');
expect(status, 'to be', 1);
expect(output.toString(), 'to contain', 'Usage: elm-app <command>');
});
it('`elm-app install` command should be available', () => {
const { output, status } = spawn.sync('elm-app', ['install', '--help']);
expect(
output.toString(),
'to contain',
'The `install` command fetches packages'
);
expect(status, 'to be', 0);
});
});
});