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

@ -47,7 +47,7 @@ function shouldBehaveLikeSet() {
it('retrieves existing element', async function () {
await this.methods.add(this.valueA);
expect(await this.methods.at(0)).to.equal(this.valueA);
expect(await this.methods.at(0)).to.deep.equal(this.valueA);
});
});
@ -109,6 +109,49 @@ function shouldBehaveLikeSet() {
expect(await this.methods.contains(this.valueB)).to.be.false;
});
});
describe('clear', function () {
it('clears a single value', async function () {
await this.methods.add(this.valueA);
await this.methods.clear();
expect(await this.methods.contains(this.valueA)).to.be.false;
await expectMembersMatch(this.methods, []);
});
it('clears multiple values', async function () {
await this.methods.add(this.valueA);
await this.methods.add(this.valueB);
await this.methods.add(this.valueC);
await this.methods.clear();
expect(await this.methods.contains(this.valueA)).to.be.false;
expect(await this.methods.contains(this.valueB)).to.be.false;
expect(await this.methods.contains(this.valueC)).to.be.false;
await expectMembersMatch(this.methods, []);
});
it('does not revert on empty set', async function () {
await this.methods.clear();
});
it('clear then add value', async function () {
await this.methods.add(this.valueA);
await this.methods.add(this.valueB);
await this.methods.add(this.valueC);
await this.methods.clear();
await this.methods.add(this.valueA);
expect(await this.methods.contains(this.valueA)).to.be.true;
expect(await this.methods.contains(this.valueB)).to.be.false;
expect(await this.methods.contains(this.valueC)).to.be.false;
await expectMembersMatch(this.methods, [this.valueA]);
});
});
}
module.exports = {