@@ -66,23 +66,7 @@ export class EnumItemClass<
6666 }
6767 return content ;
6868 }
69- private _isTesting ( ) {
70- let jestWorkerId : string | undefined = undefined ;
71- try {
72- jestWorkerId = process . env . JEST_WORKER_ID ;
73- } catch ( e ) {
74- // safely ignore
75- }
76- /* istanbul ignore next */
77- if ( jestWorkerId != null ) {
78- return ! ! jestWorkerId ;
79- } else {
80- /* istanbul ignore next */
81- return false ;
82- }
83- }
8469 private _readonlyPropMsg ( name : string ) {
85- /* istanbul ignore next */
8670 return `Cannot modify property "${ name } " on EnumItem. EnumItem instances are readonly and should not be mutated.` ;
8771 }
8872 private _localizedProxy = new Proxy ( this , {
@@ -95,31 +79,19 @@ export class EnumItemClass<
9579 } ,
9680 // Not allowed to edit
9781 set : ( _ , prop ) => {
98- /* istanbul ignore if */
99- if ( ! this . _isTesting ( ) ) {
100- console . warn ( this . _readonlyPropMsg ( String ( prop ) ) ) ;
101- }
82+ console . warn ( this . _readonlyPropMsg ( String ( prop ) ) ) ;
10283 return true ;
10384 } ,
10485 defineProperty : ( _ , prop ) => {
105- /* istanbul ignore if */
106- if ( ! this . _isTesting ( ) ) {
107- console . warn ( this . _readonlyPropMsg ( String ( prop ) ) ) ;
108- }
86+ console . warn ( this . _readonlyPropMsg ( String ( prop ) ) ) ;
10987 return true ;
11088 } ,
11189 deleteProperty : ( _ , prop ) => {
112- /* istanbul ignore if */
113- if ( ! this . _isTesting ( ) ) {
114- console . warn ( this . _readonlyPropMsg ( String ( prop ) ) ) ;
115- }
90+ console . warn ( this . _readonlyPropMsg ( String ( prop ) ) ) ;
11691 return true ;
11792 } ,
11893 setPrototypeOf : ( ) => {
119- /* istanbul ignore if */
120- if ( ! this . _isTesting ( ) ) {
121- console . warn ( 'Cannot change prototype of EnumItem. EnumItem instances are immutable.' ) ;
122- }
94+ console . warn ( 'Cannot change prototype of EnumItem. EnumItem instances are immutable.' ) ;
12395 return true ;
12496 } ,
12597 } ) ;
0 commit comments