Skip to content
This repository has been archived by the owner on Sep 3, 2021. It is now read-only.

fix: fix types and remove typesVersions #139

Merged
merged 4 commits into from
Jan 12, 2021
Merged

Conversation

hugomrdias
Copy link
Member

This PR updates aegir and fixes errors with the new ts config and removes typesVersions.

typesVersions workaround makes TS rewrite imports to cids to cids/src and because this package doesn't really needs this a workaround its just removed.

This should fix libp2p/js-libp2p#839 (comment)

This PR updates aegir and fixes errors with the new ts config and removes typesVersions.

`typesVersions` workaround makes TS rewrite imports to `cids` to `cids/src` and because this package doesn't really needs this a workaround its just removed.

This should fix libp2p/js-libp2p#839 (comment)
before(async () => {
hash = await multihashing(uint8ArrayFromString('abc'), 'sha2-256')
})
describe('CIDUtil', async () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe async for describe is supported. It'll work if this can be done within a tick (or so? there's some amount of time that mocha uses to collect all of the tests after running describe()s), but if there's more than a tiny delay then the tests will get entirely dropped from the suite. Doing the setup in an async before() is the safest bet.

running with 8.2.1, this runs a single test:

describe('foo', async () => {
  await new Promise((resolve) => setImmediate(resolve))
  it('bar', () => {})
})

but this doesn't run any:

describe('foo', async () => {
  await new Promise((resolve) => setTimeout(resolve, 0))
  it('bar', () => {})
})

did you also mean to add the @type to this one like in index.spec.js?

Copy link
Member

@vasco-santos vasco-santos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me except for Rod's comment

@hugomrdias hugomrdias requested a review from rvagg January 11, 2021 11:06
@rvagg
Copy link
Member

rvagg commented Jan 11, 2021

async on both describe() calls should probably be removed too, other than that lgtm

@vmx vmx merged commit 83f3848 into master Jan 12, 2021
@vmx vmx deleted the fix/typeVersions-aegir-update branch January 12, 2021 16:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Types] CIDs typings incompability
4 participants