File tree Expand file tree Collapse file tree 3 files changed +4
-6
lines changed Expand file tree Collapse file tree 3 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ class Enum {
24
24
*/
25
25
constructor ( ...constants ) {
26
26
const flags = { } ;
27
- let bitValue = 1 ;
27
+ let bitValue = 0 ;
28
28
let length = 0 ;
29
29
30
30
for ( const flag of constants ) {
Original file line number Diff line number Diff line change @@ -104,8 +104,8 @@ describe('BitFlags', () => {
104
104
expect ( flags . values ( ) . map ( constant => constant . name ) ) . to . deep . equal ( input ) ;
105
105
106
106
let bit = 1 ;
107
- for ( const value of flags ) {
108
- expect ( Number ( value ) ) . to . equal ( bit ) ;
107
+ for ( const flag of flags ) {
108
+ expect ( Number ( flag ) ) . to . equal ( bit ) ;
109
109
bit <<= 1 ;
110
110
}
111
111
} ) ;
Original file line number Diff line number Diff line change @@ -57,7 +57,6 @@ describe('Enum', () => {
57
57
let j = 0 ;
58
58
for ( const flag of flags ) {
59
59
expect ( flag ) . to . be . an . instanceof ( EnumConstant ) ;
60
- expect ( Number ( flag ) ) . to . not . equal ( 0 ) ;
61
60
j ++ ;
62
61
}
63
62
@@ -118,7 +117,7 @@ describe('Enum', () => {
118
117
} ) ;
119
118
120
119
describe ( '#forEach()' , ( ) => {
121
- it ( 'should iterate every value-key pair but where value is 0 ' , ( ) => {
120
+ it ( 'should iterate every value-key pair' , ( ) => {
122
121
let i = 0 ;
123
122
124
123
flags . forEach ( ( value , key , obj ) => {
@@ -127,7 +126,6 @@ describe('Enum', () => {
127
126
expect ( value ) . to . satisfy ( ( val ) => {
128
127
return ( typeof val === 'number' ) || ( val instanceof EnumConstant ) ;
129
128
} ) ;
130
- expect ( Number ( value ) ) . to . not . equal ( 0 ) ;
131
129
i ++ ;
132
130
} ) ;
133
131
You can’t perform that action at this time.
0 commit comments