1- import test from 'ava ' ;
1+ import { afterAll , beforeAll , test } from 'vitest ' ;
22import { AgileModels } from '../../../src/index.js' ;
33import { 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' ;
75
86const client = getAgileClient ( ) ;
97
108let board : any ;
119let sprint : AgileModels . Sprint ;
1210
13- test . before ( async ( ) => {
11+ beforeAll ( async ( ) => {
1412 await createAgileProject ( ) ;
1513} ) ;
1614
17- test . after ( async ( ) => {
15+ afterAll ( async ( ) => {
1816 await deleteAgileProject ( ) ;
1917} ) ;
2018
21- test . serial ( 'should create new sprint' , async t => {
19+ test . sequential ( 'should create new sprint' , async ( { expect } ) => {
2220 const boards = await client . board . getAllBoards ( { name : Constants . testAgileProjectKey } ) ;
2321
24- t . is ( boards . total , 1 ) ;
22+ expect ( boards . total ) . toBe ( 1 ) ;
2523
2624 [ board ] = boards . values ;
2725
@@ -30,12 +28,12 @@ test.serial('should create new sprint', async t => {
3028 originBoardId : board . id ,
3129 } ) ;
3230
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' ) ;
3634} ) ;
3735
38- test . serial ( 'should create and move task to sprint' , async t => {
36+ test . sequential ( 'should create and move task to sprint' , async ( { expect } ) => {
3937 const issue = await getVersion3Client ( ) . issues . createIssue ( {
4038 fields : {
4139 summary : 'Test task' ,
@@ -57,33 +55,29 @@ test.serial('should create and move task to sprint', async t => {
5755 issues : [ issue . key ] ,
5856 } ) ;
5957
60- t . truthy ( ! ! issue ) ;
58+ expect ( ! ! issue ) . toBeTruthy ( ) ;
6159} ) ;
6260
63- test . serial ( 'should return issues for sprint' , async t => {
61+ test . sequential ( 'should return issues for sprint' , async ( { expect } ) => {
6462 const { issues } = await client . sprint . getIssuesForSprint ( {
6563 sprintId : sprint . id ,
6664 } ) ;
6765
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' ) ;
7068} ) ;
7169
72- test . serial ( 'should partially update sprint' , async t => {
70+ test . sequential ( 'should partially update sprint' , async ( { expect } ) => {
7371 const newSprint = await client . sprint . partiallyUpdateSprint ( {
7472 sprintId : sprint . id ,
7573 state : 'active' ,
7674 startDate : new Date ( ) ,
7775 endDate : new Date ( Date . now ( ) + 1000 ) ,
7876 } ) ;
7977
80- t . is ( newSprint . state , 'active' ) ;
78+ expect ( newSprint . state ) . toBe ( 'active' ) ;
8179} ) ;
8280
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 } ) ;
8983} ) ;
0 commit comments