File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change
1
+ import { checkBuiltInVMAndNodeVM } from '../test-helpers/checkVM.js' ;
2
+
3
+ checkBuiltInVMAndNodeVM ( function ( vmType , setBuiltInState ) {
4
+ describe ( `JSONPath - Properties (${ vmType } )` , function ( ) {
5
+ before ( setBuiltInState ) ;
6
+
7
+ /**
8
+ *
9
+ */
10
+ class Test1 {
11
+ /**
12
+ * Test2.
13
+ */
14
+ constructor ( ) {
15
+ this . test2 = "test2" ;
16
+ }
17
+
18
+ /**
19
+ * Test3.
20
+ * @returns {string }
21
+ */
22
+ // eslint-disable-next-line class-methods-use-this
23
+ get test3 ( ) {
24
+ return "test3" ;
25
+ }
26
+ }
27
+ const json = new Test1 ( ) ;
28
+
29
+ it ( "Checking simple property" , ( ) => {
30
+ assert . equal (
31
+ jsonpath ( { json, path : "$.test2" , wrap : false } ) ,
32
+ "test2"
33
+ ) ;
34
+ } ) ;
35
+
36
+ it ( "Checking getter property" , ( ) => {
37
+ assert . equal (
38
+ jsonpath ( { json, path : "$.test3" , wrap : false } ) ,
39
+ "test3"
40
+ ) ;
41
+ } ) ;
42
+ } ) ;
43
+ } ) ;
You can’t perform that action at this time.
0 commit comments