Merge typing updates from v2-migration branch
This commit is contained in:
1553
package-lock.json
generated
1553
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -26,14 +26,14 @@
|
||||
],
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"axios": "^0.19.0",
|
||||
"typescript": "^2.6.2"
|
||||
"axios": "0.21.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/chai": "^4.1.1",
|
||||
"@types/mocha": "^2.2.46",
|
||||
"chai": "^4.1.2",
|
||||
"mocha": "^8.2.1",
|
||||
"ts-node": "^4.1.0"
|
||||
"ts-node": "^4.1.0",
|
||||
"typescript": "4.1.5"
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,7 +4,7 @@ export enum Legality {
|
||||
}
|
||||
|
||||
export interface ILegality {
|
||||
expanded: Legality | undefined
|
||||
standard: Legality | undefined
|
||||
unlimited: Legality | undefined
|
||||
expanded?: Legality;
|
||||
standard?: Legality;
|
||||
unlimited?: Legality;
|
||||
}
|
||||
@ -8,59 +8,59 @@ const expect = chai.expect;
|
||||
const client: Client = Client.getInstance();
|
||||
|
||||
describe('Client', () => {
|
||||
it('should get a single using the cards resource and query params' , () => {
|
||||
const params: Query[] = [{
|
||||
name: 'id',
|
||||
value: 'xy7-54'
|
||||
}];
|
||||
it('should get a single using the cards resource and query params' , () => {
|
||||
const params: Query[] = [{
|
||||
name: 'id',
|
||||
value: 'xy7-54'
|
||||
}];
|
||||
|
||||
client.get<Card[]>('cards', params)
|
||||
.then(response => {
|
||||
expect(response).to.be.a('array');
|
||||
expect(response[0].name).to.equal('Ampharos');
|
||||
});
|
||||
});
|
||||
client.get<Card[]>('cards', params)
|
||||
.then(response => {
|
||||
expect(response).to.be.a('array');
|
||||
expect(response[0].name).to.equal('Ampharos');
|
||||
});
|
||||
});
|
||||
|
||||
it('should get a default list of cards using the cards resource with no query params', () => {
|
||||
client.get<Card[]>('cards')
|
||||
.then(response => {
|
||||
expect(response).to.be.a('array');
|
||||
expect(response.length).to.equal(250);
|
||||
});
|
||||
});
|
||||
it('should get a default list of cards using the cards resource with no query params', () => {
|
||||
client.get<Card[]>('cards')
|
||||
.then(response => {
|
||||
expect(response).to.be.a('array');
|
||||
expect(response.length).to.equal(250);
|
||||
});
|
||||
});
|
||||
|
||||
it('should get sets using the sets resource and query params', () => {
|
||||
const params: Query[] = [{
|
||||
name: 'name',
|
||||
value: 'Base'
|
||||
}];
|
||||
it('should get sets using the sets resource and query params', () => {
|
||||
const params: Query[] = [{
|
||||
name: 'name',
|
||||
value: 'Base'
|
||||
}];
|
||||
|
||||
client.get<Set[]>('sets', params)
|
||||
.then(response => {
|
||||
expect(response).to.be.a('array');
|
||||
expect(response[0]).to.be.a('object');
|
||||
});
|
||||
});
|
||||
client.get<Set[]>('sets', params)
|
||||
.then(response => {
|
||||
expect(response).to.be.a('array');
|
||||
expect(response[0]).to.be.a('object');
|
||||
});
|
||||
});
|
||||
|
||||
it('should get a single set using the sets resource and query params', () => {
|
||||
const params: Query[] = [{
|
||||
name: 'id',
|
||||
value: 'base1'
|
||||
}];
|
||||
it('should get a single set using the sets resource and query params', () => {
|
||||
const params: Query[] = [{
|
||||
name: 'id',
|
||||
value: 'base1'
|
||||
}];
|
||||
|
||||
client.get<Set[]>('sets', params)
|
||||
.then(response => {
|
||||
expect(response).to.be.a('array');
|
||||
expect(response[0].name).to.equal('Base');
|
||||
});
|
||||
});
|
||||
client.get<Set[]>('sets', params)
|
||||
.then(response => {
|
||||
expect(response).to.be.a('array');
|
||||
expect(response[0].name).to.equal('Base');
|
||||
});
|
||||
});
|
||||
|
||||
it('should get a default list of sets using the sets resource with no query params', () => {
|
||||
client.get<Set[]>('sets')
|
||||
.then(response => {
|
||||
expect(response).to.be.a('array');
|
||||
expect(response[0]).to.be.a('object');
|
||||
expect(response[0].id).to.equal('base1');
|
||||
});
|
||||
});
|
||||
it('should get a default list of sets using the sets resource with no query params', () => {
|
||||
client.get<Set[]>('sets')
|
||||
.then(response => {
|
||||
expect(response).to.be.a('array');
|
||||
expect(response[0]).to.be.a('object');
|
||||
expect(response[0].id).to.equal('base1');
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user