|
1 | 1 | /* eslint-env mocha */
|
2 | 2 |
|
3 | 3 | import { expect } from 'chai';
|
4 |
| -import { parse } from '../../src/cli/parsers/git-cz'; |
| 4 | +import { gitCz as gitCzParser, commitizen as commitizenParser } from '../../src/cli/parsers'; |
5 | 5 |
|
6 | 6 | describe('parsers', () => {
|
7 | 7 | describe('git-cz', () => {
|
8 | 8 | it('should parse --message "Hello, World!"', () => {
|
9 |
| - expect(parse(['--amend', '--message', 'Hello, World!'])).to.deep.equal(['--amend']); |
| 9 | + expect(gitCzParser.parse(['--amend', '--message', 'Hello, World!'])).to.deep.equal(['--amend']); |
10 | 10 | });
|
11 | 11 |
|
12 | 12 | it('should parse --message="Hello, World!"', () => {
|
13 |
| - expect(parse(['--amend', '--message=Hello, World!'])).to.deep.equal(['--amend']); |
| 13 | + expect(gitCzParser.parse(['--amend', '--message=Hello, World!'])).to.deep.equal(['--amend']); |
14 | 14 | });
|
15 | 15 |
|
16 | 16 | it('should parse -amwip', () => {
|
17 |
| - expect(parse(['-amwip'])).to.deep.equal(['-a']); |
| 17 | + expect(gitCzParser.parse(['-amwip'])).to.deep.equal(['-a']); |
18 | 18 | });
|
19 | 19 |
|
20 | 20 | it('should parse -am=wip', () => {
|
21 |
| - expect(parse(['-am=wip'])).to.deep.equal(['-a']); |
| 21 | + expect(gitCzParser.parse(['-am=wip'])).to.deep.equal(['-a']); |
22 | 22 | });
|
23 | 23 |
|
24 | 24 | it('should parse -am wip', () => {
|
25 |
| - expect(parse(['-am', 'wip'])).to.deep.equal(['-a']); |
| 25 | + expect(gitCzParser.parse(['-am', 'wip'])).to.deep.equal(['-a']); |
26 | 26 | });
|
27 | 27 |
|
28 | 28 | it('should parse -a -m wip -n', () => {
|
29 |
| - expect(parse(['-a', '-m', 'wip', '-n'])).to.deep.equal(['-a', '-n']); |
| 29 | + expect(gitCzParser.parse(['-a', '-m', 'wip', '-n'])).to.deep.equal(['-a', '-n']); |
30 | 30 | });
|
31 | 31 |
|
32 | 32 | it('should parse -a -m=wip -n', () => {
|
33 |
| - expect(parse(['-a', '-m=wip', '-n'])).to.deep.equal(['-a', '-n']); |
| 33 | + expect(gitCzParser.parse(['-a', '-m=wip', '-n'])).to.deep.equal(['-a', '-n']); |
| 34 | + }); |
| 35 | + }); |
| 36 | + |
| 37 | + describe('commitizen', () => { |
| 38 | + it('should parse out the --amend option', () => { |
| 39 | + expect(commitizenParser.parse(['--amend'])).to.deep.equal({ _: [], amend: true }) |
| 40 | + }); |
| 41 | + it('should parse out the --hook option', () => { |
| 42 | + expect(commitizenParser.parse(['--hook'])).to.deep.equal({ _: [], hook: true }) |
34 | 43 | });
|
35 | 44 | });
|
36 | 45 | });
|
0 commit comments