Skip to content

Commit

Permalink
$mol_wire_async fix async test
Browse files Browse the repository at this point in the history
  • Loading branch information
zerkalica committed Oct 3, 2023
1 parent 669b575 commit b892723
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
13 changes: 5 additions & 8 deletions wire/async/async.test.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
namespace $ {

$mol_test({

'test types'( $ ) {
class A {
a() {
static a() {
return ''
}
b() {
static b() {
return $mol_wire_async(this).a()
}
}

const a = new A()
const b = a.b()
type Check = $mol_type_assert<typeof b, Promise<string>>

type Check = $mol_type_assert<ReturnType<typeof A['b']>, Promise<string>>
},

'Latest method calls wins'( $ ) {
async 'Latest method calls wins'( $ ) {

class NameLogger extends $mol_object2 {

Expand Down
8 changes: 3 additions & 5 deletions wire/sync/sync.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,16 @@ namespace $ {

'test types'( $ ) {
class A {
a() {
static a() {
return Promise.resolve('')
}

b() {
static b() {
return $mol_wire_sync(this).a()
}
}

const a = new A()
const b = a.b()
type Check = $mol_type_assert<typeof b, string>
type Check = $mol_type_assert<ReturnType<typeof A['b']>, string>
},
})

Expand Down

0 comments on commit b892723

Please sign in to comment.