Skip to content

Commit

Permalink
remove unsupported ?? operator
Browse files Browse the repository at this point in the history
  • Loading branch information
frangio committed Feb 19, 2021
1 parent 3a0323e commit a679d75
Showing 1 changed file with 21 additions and 16 deletions.
37 changes: 21 additions & 16 deletions test/token/ERC721/ERC721.behavior.js
Original file line number Diff line number Diff line change
Expand Up @@ -910,24 +910,29 @@ function shouldBehaveLikeERC721Metadata (errorPrefix, name, symbol, owner) {
);
});

it('base URI can be set', async function () {
this.token.setBaseURI ?? this.skip();
await this.token.setBaseURI(baseURI);
expect(await this.token.baseURI()).to.equal(baseURI);
});
describe('base URI', function () {
before(function () {
if (this.token.setBaseURI === undefined) {
this.skip();
}
});

it('base URI is added as a prefix to the token URI', async function () {
this.token.setBaseURI ?? this.skip();
await this.token.setBaseURI(baseURI);
expect(await this.token.tokenURI(firstTokenId)).to.be.equal(baseURI + firstTokenId.toString());
});
it('base URI can be set', async function () {
await this.token.setBaseURI(baseURI);
expect(await this.token.baseURI()).to.equal(baseURI);
});

it('token URI can be changed by changing the base URI', async function () {
this.token.setBaseURI ?? this.skip();
await this.token.setBaseURI(baseURI);
const newBaseURI = 'https://api.com/v2/';
await this.token.setBaseURI(newBaseURI);
expect(await this.token.tokenURI(firstTokenId)).to.be.equal(newBaseURI + firstTokenId.toString());
it('base URI is added as a prefix to the token URI', async function () {
await this.token.setBaseURI(baseURI);
expect(await this.token.tokenURI(firstTokenId)).to.be.equal(baseURI + firstTokenId.toString());
});

it('token URI can be changed by changing the base URI', async function () {
await this.token.setBaseURI(baseURI);
const newBaseURI = 'https://api.com/v2/';
await this.token.setBaseURI(newBaseURI);
expect(await this.token.tokenURI(firstTokenId)).to.be.equal(newBaseURI + firstTokenId.toString());
});
});
});
});
Expand Down

0 comments on commit a679d75

Please sign in to comment.