kinto.js
kinto.js copied to clipboard
Create end-to-end type test
It would be nice to have a single file that runs through all the various methods to ensure that types can pass between methods as expected.
For example:
const client = new KintoClient("http://server.com");
const createBucketResult = await client.createBucket("name");
const bucket = client.bucket(createBucketResult.data.id);
const createCollectionResult = await bucket.createCollection("things");
const collection = bucket.collection(createCollectionResult.result.id);
const createRecordResult = await collection.createRecord({ petName: "Jpeg" });
const updatedRecord = await collection.updateRecord(createRecordResult.data);
console.log(updatedRecord.data.pet);
Great, yes!
This could be part of https://github.com/Kinto/kinto-http.js/blob/master/test/integration_test.ts