1
- import test from 'ava ' ;
1
+ import { afterAll , beforeAll , test } from 'vitest ' ;
2
2
import { AgileModels } from '../../../src/index.js' ;
3
3
import { Constants } from '../constants.js' ;
4
- import {
5
- createAgileProject , deleteAgileProject , getAgileClient , getVersion3Client ,
6
- } from '../utils/index.js' ;
4
+ import { createAgileProject , deleteAgileProject , getAgileClient , getVersion3Client } from '../utils/index.js' ;
7
5
8
6
const client = getAgileClient ( ) ;
9
7
10
8
let board : any ;
11
9
let sprint : AgileModels . Sprint ;
12
10
13
- test . before ( async ( ) => {
11
+ beforeAll ( async ( ) => {
14
12
await createAgileProject ( ) ;
15
13
} ) ;
16
14
17
- test . after ( async ( ) => {
15
+ afterAll ( async ( ) => {
18
16
await deleteAgileProject ( ) ;
19
17
} ) ;
20
18
21
- test . serial ( 'should create new sprint' , async t => {
19
+ test . sequential ( 'should create new sprint' , async ( { expect } ) => {
22
20
const boards = await client . board . getAllBoards ( { name : Constants . testAgileProjectKey } ) ;
23
21
24
- t . is ( boards . total , 1 ) ;
22
+ expect ( boards . total ) . toBe ( 1 ) ;
25
23
26
24
[ board ] = boards . values ;
27
25
@@ -30,12 +28,12 @@ test.serial('should create new sprint', async t => {
30
28
originBoardId : board . id ,
31
29
} ) ;
32
30
33
- t . truthy ( ! ! sprint ) ;
34
- t . is ( sprint . name , 'New sprint' ) ;
35
- t . is ( sprint . state , 'future' ) ;
31
+ expect ( ! ! sprint ) . toBeTruthy ( ) ;
32
+ expect ( sprint . name ) . toBe ( 'New sprint' ) ;
33
+ expect ( sprint . state ) . toBe ( 'future' ) ;
36
34
} ) ;
37
35
38
- test . serial ( 'should create and move task to sprint' , async t => {
36
+ test . sequential ( 'should create and move task to sprint' , async ( { expect } ) => {
39
37
const issue = await getVersion3Client ( ) . issues . createIssue ( {
40
38
fields : {
41
39
summary : 'Test task' ,
@@ -57,33 +55,29 @@ test.serial('should create and move task to sprint', async t => {
57
55
issues : [ issue . key ] ,
58
56
} ) ;
59
57
60
- t . truthy ( ! ! issue ) ;
58
+ expect ( ! ! issue ) . toBeTruthy ( ) ;
61
59
} ) ;
62
60
63
- test . serial ( 'should return issues for sprint' , async t => {
61
+ test . sequential ( 'should return issues for sprint' , async ( { expect } ) => {
64
62
const { issues } = await client . sprint . getIssuesForSprint ( {
65
63
sprintId : sprint . id ,
66
64
} ) ;
67
65
68
- t . truthy ( ! ! issues ) ;
69
- t . is ( issues [ 0 ] . fields ?. summary , 'Test task' ) ;
66
+ expect ( ! ! issues ) . toBeTruthy ( ) ;
67
+ expect ( issues [ 0 ] . fields ?. summary ) . toBe ( 'Test task' ) ;
70
68
} ) ;
71
69
72
- test . serial ( 'should partially update sprint' , async t => {
70
+ test . sequential ( 'should partially update sprint' , async ( { expect } ) => {
73
71
const newSprint = await client . sprint . partiallyUpdateSprint ( {
74
72
sprintId : sprint . id ,
75
73
state : 'active' ,
76
74
startDate : new Date ( ) ,
77
75
endDate : new Date ( Date . now ( ) + 1000 ) ,
78
76
} ) ;
79
77
80
- t . is ( newSprint . state , 'active' ) ;
78
+ expect ( newSprint . state ) . toBe ( 'active' ) ;
81
79
} ) ;
82
80
83
- test . serial ( 'should remove sprint' , async t => {
84
- await client . sprint . deleteSprint ( {
85
- sprintId : sprint . id ,
86
- } ) ;
87
-
88
- t . pass ( ) ;
81
+ test . sequential ( 'should remove sprint' , async ( { expect } ) => {
82
+ await client . sprint . deleteSprint ( { sprintId : sprint . id } ) ;
89
83
} ) ;
0 commit comments