1
- import { getProperty } from '../../../utils' ;
1
+ import {
2
+ beforeAll ,
3
+ describe ,
4
+ expect ,
5
+ test
6
+ } from '@jest/globals' ;
7
+
8
+ import getProperty from '@webkrafters/get-property' ;
9
+
2
10
import Atom from '../../atom' ;
3
11
4
12
import Accessor from '..' ;
@@ -66,13 +74,13 @@ describe( 'Accessor class', () => {
66
74
describe ( 'addClient(...)' , ( ) => {
67
75
test ( 'adds new client id to `clients`' , ( ) => {
68
76
const numClients = accessor . numClients ;
69
- const id = expect . any ( String ) ;
77
+ const id = expect . any ( String ) as unknown as string ;
70
78
accessor . addClient ( id ) ;
71
79
expect ( accessor . numClients ) . toBe ( numClients + 1 ) ;
72
80
accessor . removeClient ( id ) ;
73
81
} ) ;
74
82
test ( 'ignores requests to add existing clients' , ( ) => {
75
- const id = expect . any ( String ) ;
83
+ const id = expect . any ( String ) as unknown as string ;
76
84
accessor . addClient ( id ) ;
77
85
const numClients = accessor . numClients ;
78
86
accessor . addClient ( id ) ;
@@ -83,27 +91,27 @@ describe( 'Accessor class', () => {
83
91
} ) ;
84
92
describe ( 'hasClient(...)' , ( ) => {
85
93
test ( 'returns `false` if client not found in `clients`' , ( ) => {
86
- const id = expect . any ( String ) ;
94
+ const id = expect . any ( String ) as unknown as string ;
87
95
accessor . removeClient ( id ) ;
88
96
expect ( accessor . hasClient ( id ) ) . toBe ( false ) ;
89
97
} ) ;
90
98
test ( 'returns `true` if client found in `clients`' , ( ) => {
91
- const id = expect . any ( String ) ;
99
+ const id = expect . any ( String ) as unknown as string ;
92
100
accessor . addClient ( id ) ;
93
101
expect ( accessor . hasClient ( id ) ) . toBe ( true ) ;
94
102
accessor . removeClient ( id ) ;
95
103
} ) ;
96
104
} ) ;
97
105
describe ( 'removeClient(...)' , ( ) => {
98
106
test ( 'removes client id from `clients`' , ( ) => {
99
- const id = expect . any ( String ) ;
107
+ const id = expect . any ( String ) as unknown as string ;
100
108
accessor . addClient ( id ) ;
101
109
const numClients = accessor . numClients ;
102
110
accessor . removeClient ( id ) ;
103
111
expect ( accessor . numClients ) . toBe ( numClients - 1 ) ;
104
112
} ) ;
105
113
test ( 'ignores requests to remove non-existing clients' , ( ) => {
106
- const id = expect . any ( String ) ;
114
+ const id = expect . any ( String ) as unknown as string ;
107
115
accessor . addClient ( id ) ;
108
116
accessor . removeClient ( id ) ;
109
117
const numClients = accessor . numClients ;
0 commit comments