Update docs

This commit is contained in:
github-actions
2025-04-22 16:39:54 +00:00
parent 0dda004024
commit da7fd0d3e5
230 changed files with 11375 additions and 1714 deletions

View File

@ -117,6 +117,49 @@ function shouldBehaveLikeMap() {
});
});
describe('clear', function () {
it('clears a single entry', async function () {
await this.methods.set(this.keyA, this.valueA);
await this.methods.clear();
expect(await this.methods.contains(this.keyA)).to.be.false;
await expectMembersMatch(this.methods, [], []);
});
it('clears multiple entries', async function () {
await this.methods.set(this.keyA, this.valueA);
await this.methods.set(this.keyB, this.valueB);
await this.methods.set(this.keyC, this.valueC);
await this.methods.clear();
expect(await this.methods.contains(this.keyA)).to.be.false;
expect(await this.methods.contains(this.keyB)).to.be.false;
expect(await this.methods.contains(this.keyC)).to.be.false;
await expectMembersMatch(this.methods, [], []);
});
it('does not revert on empty map', async function () {
await this.methods.clear();
});
it('clear then add entry', async function () {
await this.methods.set(this.keyA, this.valueA);
await this.methods.set(this.keyB, this.valueB);
await this.methods.set(this.keyC, this.valueC);
await this.methods.clear();
await this.methods.set(this.keyA, this.valueA);
expect(await this.methods.contains(this.keyA)).to.be.true;
expect(await this.methods.contains(this.keyB)).to.be.false;
expect(await this.methods.contains(this.keyC)).to.be.false;
await expectMembersMatch(this.methods, [this.keyA], [this.valueA]);
});
});
describe('read', function () {
beforeEach(async function () {
await this.methods.set(this.keyA, this.valueA);