1
1
import { git } from '@commitlint/test' ;
2
- import test from 'ava' ;
3
2
import execa from 'execa' ;
4
3
import * as sander from '@marionebl/sander' ;
5
4
6
5
import read from '.' ;
7
6
8
- test ( 'get edit commit message specified by the `edit` flag' , async t => {
7
+ test ( 'get edit commit message specified by the `edit` flag' , async ( ) => {
9
8
const cwd = await git . bootstrap ( ) ;
10
9
11
10
await sander . writeFile ( cwd , 'commit-msg-file' , 'foo' ) ;
12
11
13
12
const expected = [ 'foo\n' ] ;
14
13
const actual = await read ( { edit : 'commit-msg-file' , cwd} ) ;
15
- t . deepEqual ( actual , expected ) ;
14
+ expect ( actual ) . toEqual ( expected ) ;
16
15
} ) ;
17
16
18
- test ( 'get edit commit message from git root' , async t => {
17
+ test ( 'get edit commit message from git root' , async ( ) => {
19
18
const cwd = await git . bootstrap ( ) ;
20
19
21
20
await sander . writeFile ( cwd , 'alpha.txt' , 'alpha' ) ;
22
21
await execa ( 'git' , [ 'add' , '.' ] , { cwd} ) ;
23
22
await execa ( 'git' , [ 'commit' , '-m' , 'alpha' ] , { cwd} ) ;
24
23
const expected = [ 'alpha\n\n' ] ;
25
24
const actual = await read ( { edit : true , cwd} ) ;
26
- t . deepEqual ( actual , expected ) ;
25
+ expect ( actual ) . toEqual ( expected ) ;
27
26
} ) ;
28
27
29
- test ( 'get history commit messages' , async t => {
28
+ test ( 'get history commit messages' , async ( ) => {
30
29
const cwd = await git . bootstrap ( ) ;
31
30
await sander . writeFile ( cwd , 'alpha.txt' , 'alpha' ) ;
32
31
await execa ( 'git' , [ 'add' , 'alpha.txt' ] , { cwd} ) ;
@@ -36,10 +35,10 @@ test('get history commit messages', async t => {
36
35
37
36
const expected = [ 'remove alpha\n\n' , 'alpha\n\n' ] ;
38
37
const actual = await read ( { cwd} ) ;
39
- t . deepEqual ( actual , expected ) ;
38
+ expect ( actual ) . toEqual ( expected ) ;
40
39
} ) ;
41
40
42
- test ( 'get edit commit message from git subdirectory' , async t => {
41
+ test ( 'get edit commit message from git subdirectory' , async ( ) => {
43
42
const cwd = await git . bootstrap ( ) ;
44
43
await sander . mkdir ( cwd , 'beta' ) ;
45
44
await sander . writeFile ( cwd , 'beta/beta.txt' , 'beta' ) ;
@@ -49,5 +48,5 @@ test('get edit commit message from git subdirectory', async t => {
49
48
50
49
const expected = [ 'beta\n\n' ] ;
51
50
const actual = await read ( { edit : true , cwd} ) ;
52
- t . deepEqual ( actual , expected ) ;
51
+ expect ( actual ) . toEqual ( expected ) ;
53
52
} ) ;
0 commit comments