-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: w3up-client tsconfig.json now includes "./test" so its tests have some type checking #669
Conversation
@@ -124,17 +124,19 @@ export class Client extends Base { | |||
/** | |||
* Use a specific space. | |||
* | |||
* @param {import('./types').DID<'key'>} did |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reverting this ts api interface change web3-storage/w3up-client@ee1cf3a#r106486919
(let's introduce the DID
-> DID<'key'>
again in one fell swoop that also adjusts some @web3-storage/access/agent-data
types that still need to be done)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops this was not 'releasable' due to using test:
conventional commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change went out in [email protected]
@@ -33,6 +33,7 @@ describe('AccessClient', () => { | |||
}) | |||
|
|||
const alice = new Client(await AgentData.create(), { | |||
// @ts-ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may be able to get rid of these ts-ignore (remember: the whole file was ignored by tsc before) in a followup PR by removing the voucher
type prop from @web3-storage/access/types
ServiceType.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@travis it makes changes to some w3up-client tests that have the word 'capability' in their file name, but notably it does not make any changes to the with that said, no worries at all waiting for a review from @alanshaw or @Gozala as well |
@@ -51,9 +47,6 @@ describe('SpaceClient', () => { | |||
assert.equal(service.space.info.callCount, 1) | |||
|
|||
assert.equal(info.did, space.did()) | |||
assert.equal(info.agent, alice.agent().did()) | |||
assert.equal(info.email, 'mailto:[email protected]') | |||
assert.equal(info.product, 'product:test') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why these removals?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in order to make the type checker pass, I needed to either
- add a couple fields that I didn't understand
- I tried, eventually it was mad I wasn't about certain fields.
- That type is kinda weird because it was authored derived from the kysely ORM db row type vs something more abstract
- Which is why in spaces 'registered' via the newer provider/add, the type for space/info success is much narrower and only { did: DID<'key'> } right now. (no tests require more than that, but I suspect some will)
- or just return the new narrower { did: DID<'key'> } here to make this pass
tsc
and generally be a realistic mock of a space info result
Non-goal
Context: