Skip to content

Commit b4dd079

Browse files
committed
Added expect() statements to test cleanups in order to catch any cleanup errors. Fixed cleanup not working in context tests.
1 parent b456383 commit b4dd079

35 files changed

Lines changed: 186 additions & 160 deletions

integration-tests/access-control-native/group.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ const tests = () => describe('group', () => {
2929
});
3030

3131
after(async () => {
32-
const result = await runCommand(`itwin delete --itwin-id ${iTwinId}`);
33-
expect(result.stdout).to.contain('deleted');
32+
const { result: deleteResult } = await runCommand(`itwin delete --itwin-id ${iTwinId}`);
33+
expect(deleteResult).to.have.property('result', 'deleted');
3434
});
3535

3636
it('Should update group ims-group', async () => {

integration-tests/access-control-native/member/owner.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ const tests = () => describe('owner', () => {
2525
});
2626

2727
after(async () => {
28-
const result = await runCommand(`itwin delete --itwin-id ${iTwinId}`);
29-
expect(result.stdout).to.contain('deleted');
28+
const { result: deleteResult } = await runCommand(`itwin delete --itwin-id ${iTwinId}`);
29+
expect(deleteResult).to.have.property('result', 'deleted');
3030
});
3131

3232
it('Should add an internal member to an iTwin and remove owner member', async () => {

integration-tests/access-control-native/member/user.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ const tests = () => describe('user', () => {
2525
});
2626

2727
after(async () => {
28-
const result = await runCommand(`itwin delete --itwin-id ${iTwinId}`);
29-
expect(result.stdout).to.contain('deleted');
28+
const { result: deleteResult } = await runCommand(`itwin delete --itwin-id ${iTwinId}`);
29+
expect(deleteResult).to.have.property('result', 'deleted');
3030
});
3131

3232
it('Should add an internal member to an iTwin and remove user member', async () => {

integration-tests/access-control/group.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ const tests = () => {
2121
});
2222

2323
after(async () => {
24-
const result = await runCommand(`itwin delete --itwin-id ${iTwinId}`);
25-
expect(result.stdout).to.contain('deleted');
24+
const { result: deleteResult } = await runCommand(`itwin delete --itwin-id ${iTwinId}`);
25+
expect(deleteResult).to.have.property('result', 'deleted');
2626
});
2727

2828
it('Should create and update group info', async () => {

integration-tests/access-control/member/group.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ const tests = () => {
3232
});
3333

3434
after(async () => {
35-
const result = await runCommand(`itwin delete --itwin-id ${iTwinId}`);
36-
expect(result.stdout).to.contain('deleted');
35+
const { result: deleteResult } = await runCommand(`itwin delete --itwin-id ${iTwinId}`);
36+
expect(deleteResult).to.have.property('result', 'deleted');
3737
});
3838

3939
it('Should create, update and list info and delete member group', async () => {

integration-tests/access-control/member/invitations.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ const tests = () => {
2222
});
2323

2424
after(async () => {
25-
const result = await runCommand(`itwin delete --itwin-id ${iTwinId}`);
26-
expect(result.stdout).to.contain('deleted');
25+
const { result: deleteResult } = await runCommand(`itwin delete --itwin-id ${iTwinId}`);
26+
expect(deleteResult).to.have.property('result', 'deleted');
2727
});
2828

2929
it('Should get pending invitations', async () => {

integration-tests/access-control/member/owner.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ const tests = () => {
2424
});
2525

2626
after(async () => {
27-
const result = await runCommand(`itwin delete --itwin-id ${iTwinId}`);
28-
expect(result.stdout).to.contain('deleted');
27+
const { result: deleteResult } = await runCommand(`itwin delete --itwin-id ${iTwinId}`);
28+
expect(deleteResult).to.have.property('result', 'deleted');
2929
});
3030

3131
it('Should invite an external member to an iTwin, accept invitation and remove owner member', async () => {

integration-tests/access-control/member/user.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ const tests = () => {
2424
});
2525

2626
after(async () => {
27-
const result = await runCommand(`itwin delete --itwin-id ${iTwinId}`);
28-
expect(result.stdout).to.contain('deleted');
27+
const { result: deleteResult } = await runCommand(`itwin delete --itwin-id ${iTwinId}`);
28+
expect(deleteResult).to.have.property('result', 'deleted');
2929
});
3030

3131
it('Should invite an external member to an iTwin, accept sent invitation and remove user member', async () => {

integration-tests/access-control/permissions.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ const tests = () => {
2020
});
2121

2222
after(async () => {
23-
const result = await runCommand(`itwin delete --itwin-id ${iTwinId}`);
24-
expect(result.stdout).to.contain('deleted');
23+
const { result: deleteResult} = await runCommand(`itwin delete --itwin-id ${iTwinId}`);
24+
expect(deleteResult).to.have.property('result', 'deleted');
2525
});
2626

2727
it('Should retrieve my permissions', async () => {

integration-tests/access-control/role.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ const tests = () => {
2121
});
2222

2323
after(async () => {
24-
const result = await runCommand(`itwin delete --itwin-id ${iTwinId}`);
25-
expect(result.stdout).to.contain('deleted');
24+
const { result: deleteResult } = await runCommand(`itwin delete --itwin-id ${iTwinId}`);
25+
expect(deleteResult).to.have.property('result', 'deleted');
2626
});
2727

2828
it('Should create and update role info', async () => {

0 commit comments

Comments
 (0)