Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 committed May 30, 2024
1 parent bebc320 commit eb8a756
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/repository/ScopeRepository.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ describe('test/repository/ScopeRepository.test.ts', () => {
registryId: '1',
})) as Scope;
const scopeRes = await scopeRepository.listScopes({});
assert.deepEqual([ cnpmjsScope.name, cnpmScope.name ], scopeRes.data.map(scope => scope.name));
assert.deepEqual([ cnpmjsScope.name, cnpmScope.name ],
Array.from(scopeRes.data.map(scope => scope.name)));
});

it('update work', async () => {
Expand All @@ -56,10 +57,11 @@ describe('test/repository/ScopeRepository.test.ts', () => {
})) as Scope;
await scopeRepository.removeScope(cnpmjsScope.scopeId);
const scopesAfterRemove = await scopeRepository.listScopes({});
assert.deepEqual(scopesAfterRemove.data.map(scope => scope.name), [ cnpmScope.name ]);
assert.deepEqual(Array.from(scopesAfterRemove.data.map(scope => scope.name)),
[ cnpmScope.name ]);
await scopeRepository.removeScopeByRegistryId(cnpmjsScope.registryId);
const emptyRes = await scopeRepository.listScopes({});
assert.deepEqual(emptyRes.data, []);
assert.deepEqual(Array.from(emptyRes.data), []);
});
});
});

0 comments on commit eb8a756

Please sign in to comment.